Xyce  6.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
N_DEV_ADMSPSP103VA.C
Go to the documentation of this file.
1 
2 //-----------------------------------------------------------------------------
3 // Copyright Notice
4 //
5 // Copyright 2002 Sandia Corporation. Under the terms
6 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
7 // Government retains certain rights in this software.
8 //
9 // Xyce(TM) Parallel Electrical Simulator
10 // Copyright (C) 2002-2014 Sandia Corporation
11 //
12 // This program is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, see <http://www.gnu.org/licenses/>.
24 //-----------------------------------------------------------------------------
25 
26 //-------------------------------------------------------------------------
27 // Filename : $RCSfile: N_DEV_ADMSPSP103VA.C,v $
28 //
29 // Purpose :
30 //
31 // Special Notes : Generated from verilog file psp103.va with ADMS
32 // interface for Xyce 6.1.0
33 // DO NOT EDIT THIS FILE DIRECTLY! It may be overwritten!
34 //
35 // Creator : admsXml-2.3.0
36 //
37 // Creation Date : Thu, 06 Mar 2014 16:00:33
38 //
39 // Revision Information:
40 // ---------------------
41 //
42 // Revision Number: $Revision: 1.47.2.4 $
43 //
44 // Revision Date : $Date: 2014/03/06 23:33:42 $
45 //
46 // Current Owner : $Author: tvrusso $
47 //-------------------------------------------------------------------------
48 
49 #include <Xyce_config.h>
50 #include <N_DEV_ADMSPSP103VA.h>
51 
52 
53 #include <N_UTL_Misc.h>
54 
55 #include <N_DEV_Const.h>
56 #include <N_DEV_DeviceOptions.h>
57 #include <N_DEV_DeviceMaster.h>
58 #include <N_DEV_ExternData.h>
59 #include <N_DEV_MatrixLoadData.h>
60 #include <N_DEV_SolverState.h>
61 #include <N_DEV_Message.h>
62 
63 #include <N_LAS_Matrix.h>
64 #include <N_LAS_Vector.h>
65 
66 namespace Xyce {
67 namespace Device {
68 namespace ADMSPSP103VA {
69 
70 
71 void
73 {
74  // Set up each parameter directly, using the up-cased variable name
75  // as the tag.
76 
77  // This kludge is to force us always to have an instance parameter
78  // that the device manager can set to the temperature, even if we have
79  // no "TEMP".
80  p.addPar("XYCEADMSINSTTEMP", 0.0, &ADMSPSP103VA::Instance::admsInstTemp)
81  .setExpressionAccess(NO_DOC)
82  .setUnit(U_DEGK)
83  .setCategory(CAT_TEMP)
84  .setDescription("Internal-use parameter for setting device instance temperature");
85  p.addPar("L", static_cast<double>(10e-6), &ADMSPSP103VA::Instance::L)
86  .setUnit(U_METER)
87  .setDescription("Design length");
88  p.addPar("W", static_cast<double>(10e-6), &ADMSPSP103VA::Instance::W)
89  .setUnit(U_METER)
90  .setDescription("Design width");
91  p.addPar("SA", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SA)
92  .setUnit(U_METER)
93  .setDescription("Distance between OD-edge and poly from one side");
94  p.addPar("SB", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SB)
95  .setUnit(U_METER)
96  .setDescription("Distance between OD-edge and poly from other side");
97  p.addPar("SD", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SD)
98  .setUnit(U_METER)
99  .setDescription("Distance between neighbouring fingers");
100  p.addPar("SCA", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SCA)
101  .setDescription("Integral of the first distribution function for scattered well dopants");
102  p.addPar("SCB", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SCB)
103  .setDescription("Integral of the second distribution function for scattered well dopants");
104  p.addPar("SCC", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SCC)
105  .setDescription("Integral of the third distribution function for scattered well dopants");
106  p.addPar("SC", static_cast<double>(0.0), &ADMSPSP103VA::Instance::SC)
107  .setUnit(U_METER)
108  .setDescription("Distance between OD-edge and nearest well edge");
109  p.addPar("NF", static_cast<double>(1.0), &ADMSPSP103VA::Instance::NF)
110  .setDescription("Number of fingers");
111  p.addPar("NGCON", static_cast<double>(1.0), &ADMSPSP103VA::Instance::NGCON)
112  .setDescription("Number of gate contacts");
113  p.addPar("XGW", static_cast<double>(1.0E-7), &ADMSPSP103VA::Instance::XGW)
114  .setUnit(U_METER)
115  .setDescription("Distance from the gate contact to the channel edge");
116  p.addPar("NRS", static_cast<double>(0.0), &ADMSPSP103VA::Instance::NRS)
117  .setDescription("Number of squares of source diffusion");
118  p.addPar("NRD", static_cast<double>(0.0), &ADMSPSP103VA::Instance::NRD)
119  .setDescription("Number of squares of drain diffusion");
120  p.addPar("JW", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::JW)
121  .setUnit(U_METER)
122  .setDescription("Gate-edge length of source/drain junction");
123  p.addPar("DELVTO", static_cast<double>(0.0), &ADMSPSP103VA::Instance::DELVTO)
124  .setUnit(U_VOLT)
125  .setDescription("Threshold voltage shift parameter");
126  p.addPar("FACTUO", static_cast<double>(1.0), &ADMSPSP103VA::Instance::FACTUO)
127  .setDescription("Zero-field mobility pre-factor");
128  p.addPar("ABSOURCE", static_cast<double>(1E-12), &ADMSPSP103VA::Instance::ABSOURCE)
129  .setDescription("Bottom area of source junction");
130  p.addPar("LSSOURCE", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::LSSOURCE)
131  .setUnit(U_METER)
132  .setDescription("STI-edge length of source junction");
133  p.addPar("LGSOURCE", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::LGSOURCE)
134  .setUnit(U_METER)
135  .setDescription("Gate-edge length of source junction");
136  p.addPar("ABDRAIN", static_cast<double>(1E-12), &ADMSPSP103VA::Instance::ABDRAIN)
137  .setDescription("Bottom area of drain junction");
138  p.addPar("LSDRAIN", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::LSDRAIN)
139  .setUnit(U_METER)
140  .setDescription("STI-edge length of drain junction");
141  p.addPar("LGDRAIN", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::LGDRAIN)
142  .setUnit(U_METER)
143  .setDescription("Gate-edge length of drain junction");
144  p.addPar("AS", static_cast<double>(1E-12), &ADMSPSP103VA::Instance::AS)
145  .setDescription("Bottom area of source junction");
146  p.addPar("PS", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::PS)
147  .setUnit(U_METER)
148  .setDescription("Perimeter of source junction");
149  p.addPar("AD", static_cast<double>(1E-12), &ADMSPSP103VA::Instance::AD)
150  .setDescription("Bottom area of drain junction");
151  p.addPar("PD", static_cast<double>(1E-6), &ADMSPSP103VA::Instance::PD)
152  .setUnit(U_METER)
153  .setDescription("Perimeter of drain junction");
154  p.addPar("MULT", static_cast<double>(1.0), &ADMSPSP103VA::Instance::MULT)
155  .setDescription("Number of devices in parallel");
156 
157 
158 }
159 
161 {
162  // Set up each parameter directly, using the up-cased variable name
163  // as the tag.
164 
165  // This kludge is to force us always to have a model parameter
166  // that the device manager can set to the temperature, even if we have
167  // no "TEMP".
168  p.addPar("XYCEADMSMODTEMP", 0.0, &ADMSPSP103VA::Model::admsModTemp)
169  .setExpressionAccess(NO_DOC)
170  .setUnit(U_DEGK)
171  .setCategory(CAT_TEMP)
172  .setDescription("Internal-use parameter for setting device model temperature");
173  p.addPar("LEVEL", static_cast<double>(103), &ADMSPSP103VA::Model::LEVEL)
174  .setDescription("Model level");
175  p.addPar("TYPE", static_cast<double>(1.0), &ADMSPSP103VA::Model::TYPE)
176  .setDescription("Channel type parameter, +1=NMOS -1=PMOS");
177  p.addPar("TR", static_cast<double>(21.0), &ADMSPSP103VA::Model::TR)
178  .setUnit(U_DEGC)
179 
180  .setDescription("nominal (reference) temperature");
181  p.addPar("SWGEO", static_cast<double>(1.0), &ADMSPSP103VA::Model::SWGEO)
182  .setDescription("Flag for geometrical model, 0=local, 1=global, 2=binning");
183  p.addPar("SWIGATE", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWIGATE)
184  .setDescription("Flag for gate current, 0=turn off IG");
185  p.addPar("SWIMPACT", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWIMPACT)
186  .setDescription("Flag for impact ionization current, 0=turn off II");
187  p.addPar("SWGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWGIDL)
188  .setDescription("Flag for GIDL current, 0=turn off IGIDL");
189  p.addPar("SWJUNCAP", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWJUNCAP)
190  .setDescription("Flag for juncap, 0=turn off juncap");
191  p.addPar("SWJUNASYM", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWJUNASYM)
192  .setDescription("Flag for asymmetric junctions; 0=symmetric, 1=asymmetric");
193  p.addPar("SWNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWNUD)
194  .setDescription("Flag for NUD-effect; 0=off, 1=on, 2=on+CV-correction");
195  p.addPar("SWDELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWDELVTAC)
196  .setDescription("Flag for separate capacitance calculation; 0=off, 1=on");
197  p.addPar("QMC", static_cast<double>(1.0), &ADMSPSP103VA::Model::QMC)
198  .setDescription("Quantum-mechanical correction factor");
199  p.addPar("VFB", static_cast<double>((-1.0)), &ADMSPSP103VA::Model::VFB)
200  .setUnit(U_VOLT)
201 
202  .setDescription("Flat band voltage at TR");
203  p.addPar("STVFB", static_cast<double>(5.0e-4), &ADMSPSP103VA::Model::STVFB)
204  .setUnit(U_VKM1)
205 
206  .setDescription("Temperature dependence of VFB");
207  p.addPar("TOX", static_cast<double>(2.0e-09), &ADMSPSP103VA::Model::TOX)
208  .setUnit(U_METER)
209 
210  .setDescription("Gate oxide thickness");
211  p.addPar("EPSROX", static_cast<double>(3.9), &ADMSPSP103VA::Model::EPSROX)
212  .setDescription("Relative permittivity of gate dielectric");
213  p.addPar("NEFF", static_cast<double>(5.0e+23), &ADMSPSP103VA::Model::NEFF)
214  .setUnit(U_METERM3)
215 
216  .setDescription("Effective substrate doping");
217  p.addPar("FACNEFFAC", static_cast<double>(1.0), &ADMSPSP103VA::Model::FACNEFFAC)
218  .setDescription("Pre-factor for effective substrate doping in separate charge calculation");
219  p.addPar("GFACNUD", static_cast<double>(1.0), &ADMSPSP103VA::Model::GFACNUD)
220  .setDescription("Bodyfactor change due to NUD-effect");
221  p.addPar("VSBNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::VSBNUD)
222  .setUnit(U_VOLT)
223 
224  .setDescription("Lower Vsb value for NUD-effect");
225  p.addPar("DVSBNUD", static_cast<double>(1.0), &ADMSPSP103VA::Model::DVSBNUD)
226  .setUnit(U_VOLT)
227 
228  .setDescription("Vsb-range for NUD-effect");
229  p.addPar("VNSUB", static_cast<double>(0.0), &ADMSPSP103VA::Model::VNSUB)
230  .setUnit(U_VOLT)
231 
232  .setDescription("Effective doping bias-dependence parameter");
233  p.addPar("NSLP", static_cast<double>(0.05), &ADMSPSP103VA::Model::NSLP)
234  .setUnit(U_VOLT)
235 
236  .setDescription("Effective doping bias-dependence parameter");
237  p.addPar("DNSUB", static_cast<double>(0.0), &ADMSPSP103VA::Model::DNSUB)
238  .setUnit(U_VOLTM1)
239 
240  .setDescription("Effective doping bias-dependence parameter");
241  p.addPar("DPHIB", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIB)
242  .setUnit(U_VOLT)
243 
244  .setDescription("Offset parameter for PHIB");
245  p.addPar("DELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTAC)
246  .setUnit(U_VOLT)
247 
248  .setDescription("Offset parameter for PHIB in separate charge calculation");
249  p.addPar("NP", static_cast<double>(1.0e+26), &ADMSPSP103VA::Model::NP)
250  .setUnit(U_METERM3)
251 
252  .setDescription("Gate poly-silicon doping");
253  p.addPar("CT", static_cast<double>(0.0), &ADMSPSP103VA::Model::CT)
254  .setDescription("Interface states factor");
255  p.addPar("TOXOV", static_cast<double>(2.0e-09), &ADMSPSP103VA::Model::TOXOV)
256  .setUnit(U_METER)
257 
258  .setDescription("Overlap oxide thickness");
259  p.addPar("TOXOVD", static_cast<double>(2.0e-09), &ADMSPSP103VA::Model::TOXOVD)
260  .setUnit(U_METER)
261 
262  .setDescription("Overlap oxide thickness for drain side");
263  p.addPar("NOV", static_cast<double>(5.0e+25), &ADMSPSP103VA::Model::NOV)
264  .setUnit(U_METERM3)
265 
266  .setDescription("Effective doping of overlap region");
267  p.addPar("NOVD", static_cast<double>(5.0e+25), &ADMSPSP103VA::Model::NOVD)
268  .setUnit(U_METERM3)
269 
270  .setDescription("Effective doping of overlap region for drain side");
271  p.addPar("CF", static_cast<double>(0.0), &ADMSPSP103VA::Model::CF)
272  .setDescription("DIBL-parameter");
273  p.addPar("CFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFB)
274  .setUnit(U_VOLTM1)
275 
276  .setDescription("Back bias dependence of CF");
277  p.addPar("BETN", static_cast<double>(7e-2), &ADMSPSP103VA::Model::BETN)
278  .setUnit(U_M2VM1SM1)
279 
280  .setDescription("Channel aspect ratio times zero-field mobility");
281  p.addPar("STBET", static_cast<double>(1.0), &ADMSPSP103VA::Model::STBET)
282  .setDescription("Temperature dependence of BETN");
283  p.addPar("MUE", static_cast<double>(0.5), &ADMSPSP103VA::Model::MUE)
284  .setUnit(U_MVM1)
285 
286  .setDescription("Mobility reduction coefficient at TR");
287  p.addPar("STMUE", static_cast<double>(0.0), &ADMSPSP103VA::Model::STMUE)
288  .setDescription("Temperature dependence of MUE");
289  p.addPar("THEMU", static_cast<double>(1.5), &ADMSPSP103VA::Model::THEMU)
290  .setDescription("Mobility reduction exponent at TR");
291  p.addPar("STTHEMU", static_cast<double>(1.5), &ADMSPSP103VA::Model::STTHEMU)
292  .setDescription("Temperature dependence of THEMU");
293  p.addPar("CS", static_cast<double>(0.0), &ADMSPSP103VA::Model::CS)
294  .setDescription("Coulomb scattering parameter at TR");
295  p.addPar("STCS", static_cast<double>(0.0), &ADMSPSP103VA::Model::STCS)
296  .setDescription("Temperature dependence of CS");
297  p.addPar("XCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCOR)
298  .setUnit(U_VOLTM1)
299 
300  .setDescription("Non-universality factor");
301  p.addPar("STXCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::STXCOR)
302  .setDescription("Temperature dependence of XCOR");
303  p.addPar("FETA", static_cast<double>(1.0), &ADMSPSP103VA::Model::FETA)
304  .setDescription("Effective field parameter");
305  p.addPar("RS", static_cast<double>(30), &ADMSPSP103VA::Model::RS)
306  .setUnit(U_OHM)
307 
308  .setDescription("Series resistance at TR");
309  p.addPar("STRS", static_cast<double>(1.0), &ADMSPSP103VA::Model::STRS)
310  .setDescription("Temperature dependence of RS");
311  p.addPar("RSB", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSB)
312  .setUnit(U_VOLTM1)
313 
314  .setDescription("Back-bias dependence of series resistance");
315  p.addPar("RSG", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSG)
316  .setUnit(U_VOLTM1)
317 
318  .setDescription("Gate-bias dependence of series resistance");
319  p.addPar("THESAT", static_cast<double>(1.0), &ADMSPSP103VA::Model::THESAT)
320  .setUnit(U_VOLTM1)
321 
322  .setDescription("Velocity saturation parameter at TR");
323  p.addPar("STTHESAT", static_cast<double>(1.0), &ADMSPSP103VA::Model::STTHESAT)
324  .setDescription("Temperature dependence of THESAT");
325  p.addPar("THESATB", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATB)
326  .setUnit(U_VOLTM1)
327 
328  .setDescription("Back-bias dependence of velocity saturation");
329  p.addPar("THESATG", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATG)
330  .setUnit(U_VOLTM1)
331 
332  .setDescription("Gate-bias dependence of velocity saturation");
333  p.addPar("AX", static_cast<double>(3.0), &ADMSPSP103VA::Model::AX)
334  .setDescription("Linear/saturation transition factor");
335  p.addPar("ALP", static_cast<double>(0.01), &ADMSPSP103VA::Model::ALP)
336  .setDescription("CLM pre-factor");
337  p.addPar("ALP1", static_cast<double>(0.00), &ADMSPSP103VA::Model::ALP1)
338  .setUnit(U_VOLT)
339 
340  .setDescription("CLM enhancement factor above threshold");
341  p.addPar("ALP2", static_cast<double>(0.00), &ADMSPSP103VA::Model::ALP2)
342  .setUnit(U_VOLTM1)
343 
344  .setDescription("CLM enhancement factor below threshold");
345  p.addPar("VP", static_cast<double>(0.05), &ADMSPSP103VA::Model::VP)
346  .setUnit(U_VOLT)
347 
348  .setDescription("CLM logarithm dependence factor");
349  p.addPar("A1", static_cast<double>(1.0), &ADMSPSP103VA::Model::A1)
350  .setDescription("Impact-ionization pre-factor");
351  p.addPar("A2", static_cast<double>(10.0), &ADMSPSP103VA::Model::A2)
352  .setUnit(U_VOLT)
353 
354  .setDescription("Impact-ionization exponent at TR");
355  p.addPar("STA2", static_cast<double>(0.0), &ADMSPSP103VA::Model::STA2)
356  .setUnit(U_VOLT)
357 
358  .setDescription("Temperature dependence of A2");
359  p.addPar("A3", static_cast<double>(1.0), &ADMSPSP103VA::Model::A3)
360  .setDescription("Saturation-voltage dependence of impact-ionization");
361  p.addPar("A4", static_cast<double>(0.0), &ADMSPSP103VA::Model::A4)
362  .setUnit(U_VOLTMH)
363 
364  .setDescription("Back-bias dependence of impact-ionization");
365  p.addPar("GCO", static_cast<double>(0.0), &ADMSPSP103VA::Model::GCO)
366  .setDescription("Gate tunneling energy adjustment");
367  p.addPar("IGINV", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGINV)
368  .setUnit(U_AMP)
369 
370  .setDescription("Gate channel current pre-factor");
371  p.addPar("IGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGOV)
372  .setUnit(U_AMP)
373 
374  .setDescription("Gate overlap current pre-factor");
375  p.addPar("IGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGOVD)
376  .setUnit(U_AMP)
377 
378  .setDescription("Gate overlap current pre-factor for drain side");
379  p.addPar("STIG", static_cast<double>(2.0), &ADMSPSP103VA::Model::STIG)
380  .setDescription("Temperature dependence of IGINV and IGOV");
381  p.addPar("GC2", static_cast<double>(0.375), &ADMSPSP103VA::Model::GC2)
382  .setDescription("Gate current slope factor");
383  p.addPar("GC3", static_cast<double>(0.063), &ADMSPSP103VA::Model::GC3)
384  .setDescription("Gate current curvature factor");
385  p.addPar("CHIB", static_cast<double>(3.1), &ADMSPSP103VA::Model::CHIB)
386  .setUnit(U_VOLT)
387 
388  .setDescription("Tunneling barrier height");
389  p.addPar("AGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::AGIDL)
390  .setUnit(U_AMPVM3)
391 
392  .setDescription("GIDL pre-factor");
393  p.addPar("AGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::AGIDLD)
394  .setUnit(U_AMPVM3)
395 
396  .setDescription("GIDL pre-factor for drain side");
397  p.addPar("BGIDL", static_cast<double>(41.0), &ADMSPSP103VA::Model::BGIDL)
398  .setUnit(U_VOLT)
399 
400  .setDescription("GIDL probability factor at TR");
401  p.addPar("BGIDLD", static_cast<double>(41.0), &ADMSPSP103VA::Model::BGIDLD)
402  .setUnit(U_VOLT)
403 
404  .setDescription("GIDL probability factor at TR for drain side");
405  p.addPar("STBGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBGIDL)
406  .setUnit(U_VKM1)
407 
408  .setDescription("Temperature dependence of BGIDL");
409  p.addPar("STBGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBGIDLD)
410  .setUnit(U_VKM1)
411 
412  .setDescription("Temperature dependence of BGIDL for drain side");
413  p.addPar("CGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGIDL)
414  .setDescription("Back-bias dependence of GIDL");
415  p.addPar("CGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGIDLD)
416  .setDescription("Back-bias dependence of GIDL for drain side");
417  p.addPar("COX", static_cast<double>(1.0e-14), &ADMSPSP103VA::Model::COX)
418  .setUnit(U_FARAD)
419 
420  .setDescription("Oxide capacitance for intrinsic channel");
421  p.addPar("CGOV", static_cast<double>(1.0e-15), &ADMSPSP103VA::Model::CGOV)
422  .setUnit(U_FARAD)
423 
424  .setDescription("Oxide capacitance for gate-drain/source overlap");
425  p.addPar("CGOVD", static_cast<double>(1.0e-15), &ADMSPSP103VA::Model::CGOVD)
426  .setUnit(U_FARAD)
427 
428  .setDescription("Oxide capacitance for gate-drain overlap");
429  p.addPar("CGBOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGBOV)
430  .setUnit(U_FARAD)
431 
432  .setDescription("Oxide capacitance for gate-bulk overlap");
433  p.addPar("CFR", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFR)
434  .setUnit(U_FARAD)
435 
436  .setDescription("Outer fringe capacitance");
437  p.addPar("CFRD", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFRD)
438  .setUnit(U_FARAD)
439 
440  .setDescription("Outer fringe capacitance for drain side");
441  p.addPar("FNT", static_cast<double>(1.0), &ADMSPSP103VA::Model::FNT)
442  .setDescription("Thermal noise coefficient");
443  p.addPar("NFA", static_cast<double>(8.0e+22), &ADMSPSP103VA::Model::NFA)
444  .setDescription("First coefficient of flicker noise");
445  p.addPar("NFB", static_cast<double>(3.0e+07), &ADMSPSP103VA::Model::NFB)
446  .setDescription("Second coefficient of flicker noise");
447  p.addPar("NFC", static_cast<double>(0.0), &ADMSPSP103VA::Model::NFC)
448  .setUnit(U_VOLTM1)
449 
450  .setDescription("Third coefficient of flicker noise");
451  p.addPar("EF", static_cast<double>(1.0), &ADMSPSP103VA::Model::EF)
452  .setDescription("Flicker noise frequency exponent");
453  p.addPar("RG", static_cast<double>(0.0), &ADMSPSP103VA::Model::RG)
454  .setUnit(U_OHM)
455 
456  .setDescription("Gate resistance");
457  p.addPar("RSE", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSE)
458  .setUnit(U_OHM)
459 
460  .setDescription("External source resistance");
461  p.addPar("RDE", static_cast<double>(0.0), &ADMSPSP103VA::Model::RDE)
462  .setUnit(U_OHM)
463 
464  .setDescription("External drain resistance");
465  p.addPar("RBULK", static_cast<double>(0.0), &ADMSPSP103VA::Model::RBULK)
466  .setUnit(U_OHM)
467 
468  .setDescription("Bulk resistance between node BP and BI");
469  p.addPar("RWELL", static_cast<double>(0.0), &ADMSPSP103VA::Model::RWELL)
470  .setUnit(U_OHM)
471 
472  .setDescription("Well resistance between node BI and B");
473  p.addPar("RJUNS", static_cast<double>(0.0), &ADMSPSP103VA::Model::RJUNS)
474  .setUnit(U_OHM)
475 
476  .setDescription("Source-side bulk resistance between node BI and BS");
477  p.addPar("RJUND", static_cast<double>(0.0), &ADMSPSP103VA::Model::RJUND)
478  .setUnit(U_OHM)
479 
480  .setDescription("Drain-side bulk resistance between node BI and BD");
481  p.addPar("POVFB", static_cast<double>((-1)), &ADMSPSP103VA::Model::POVFB)
482  .setUnit(U_VOLT)
483 
484  .setDescription("Coefficient for the geometry independent part of VFB");
485  p.addPar("PLVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLVFB)
486  .setUnit(U_VOLT)
487 
488  .setDescription("Coefficient for the length dependence of VFB");
489  p.addPar("PWVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWVFB)
490  .setUnit(U_VOLT)
491 
492  .setDescription("Coefficient for the width dependence of VFB");
493  p.addPar("PLWVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWVFB)
494  .setUnit(U_VOLT)
495 
496  .setDescription("Coefficient for the length times width dependence of VFB");
497  p.addPar("POSTVFB", static_cast<double>(0.0005), &ADMSPSP103VA::Model::POSTVFB)
498  .setUnit(U_VKM1)
499 
500  .setDescription("Coefficient for the geometry independent part of STVFB");
501  p.addPar("PLSTVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLSTVFB)
502  .setUnit(U_VKM1)
503 
504  .setDescription("Coefficient for the length dependence of STVFB");
505  p.addPar("PWSTVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWSTVFB)
506  .setUnit(U_VKM1)
507 
508  .setDescription("Coefficient for the width dependence of STVFB");
509  p.addPar("PLWSTVFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWSTVFB)
510  .setUnit(U_VKM1)
511 
512  .setDescription("Coefficient for the length times width dependence of STVFB");
513  p.addPar("POTOX", static_cast<double>(2E-09), &ADMSPSP103VA::Model::POTOX)
514  .setUnit(U_METER)
515 
516  .setDescription("Coefficient for the geometry independent part of TOX");
517  p.addPar("POEPSROX", static_cast<double>(3.9), &ADMSPSP103VA::Model::POEPSROX)
518  .setDescription("Coefficient for the geometry independent part of EPSOX");
519  p.addPar("PONEFF", static_cast<double>(5E+23), &ADMSPSP103VA::Model::PONEFF)
520  .setUnit(U_METERM3)
521 
522  .setDescription("Coefficient for the geometry independent part of NEFF");
523  p.addPar("PLNEFF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNEFF)
524  .setUnit(U_METERM3)
525 
526  .setDescription("Coefficient for the length dependence of NEFF");
527  p.addPar("PWNEFF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNEFF)
528  .setUnit(U_METERM3)
529 
530  .setDescription("Coefficient for the width dependence of NEFF");
531  p.addPar("PLWNEFF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNEFF)
532  .setUnit(U_METERM3)
533 
534  .setDescription("Coefficient for the length times width dependence of NEFF");
535  p.addPar("POFACNEFFAC", static_cast<double>(1.0), &ADMSPSP103VA::Model::POFACNEFFAC)
536  .setDescription("Coefficient for the geometry independent part of FACNEFFAC");
537  p.addPar("PLFACNEFFAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLFACNEFFAC)
538  .setDescription("Coefficient for the length dependence of FACNEFFAC");
539  p.addPar("PWFACNEFFAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWFACNEFFAC)
540  .setDescription("Coefficient for the width dependence of FACNEFFAC");
541  p.addPar("PLWFACNEFFAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWFACNEFFAC)
542  .setDescription("Coefficient for the length times width dependence of FACNEFFAC");
543  p.addPar("POGFACNUD", static_cast<double>(1.0), &ADMSPSP103VA::Model::POGFACNUD)
544  .setDescription("Coefficient for the geometry independent part of GFACNUD");
545  p.addPar("PLGFACNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLGFACNUD)
546  .setDescription("Coefficient for the length dependence of GFACNUD");
547  p.addPar("PWGFACNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWGFACNUD)
548  .setDescription("Coefficient for the width dependence of GFACNUD");
549  p.addPar("PLWGFACNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWGFACNUD)
550  .setDescription("Coefficient for the length times width dependence of GFACNUD");
551  p.addPar("POVSBNUD", static_cast<double>(0.0), &ADMSPSP103VA::Model::POVSBNUD)
552  .setUnit(U_VOLT)
553 
554  .setDescription("Coefficient for the geometry independent part of VSBNUD");
555  p.addPar("PODVSBNUD", static_cast<double>(1.0), &ADMSPSP103VA::Model::PODVSBNUD)
556  .setUnit(U_VOLT)
557 
558  .setDescription("Coefficient for the geometry independent part of DVSBNUD");
559  p.addPar("POVNSUB", static_cast<double>(0), &ADMSPSP103VA::Model::POVNSUB)
560  .setUnit(U_VOLT)
561 
562  .setDescription("Coefficient for the geometry independent part of VNSUB");
563  p.addPar("PONSLP", static_cast<double>(0.05), &ADMSPSP103VA::Model::PONSLP)
564  .setUnit(U_VOLT)
565 
566  .setDescription("Coefficient for the geometry independent part of NSLP");
567  p.addPar("PODNSUB", static_cast<double>(0), &ADMSPSP103VA::Model::PODNSUB)
568  .setDescription("Coefficient for the geometry independent part of DNSUB");
569  p.addPar("PODPHIB", static_cast<double>(0), &ADMSPSP103VA::Model::PODPHIB)
570  .setUnit(U_VOLT)
571 
572  .setDescription("Coefficient for the geometry independent part of DPHIB");
573  p.addPar("PLDPHIB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLDPHIB)
574  .setUnit(U_VOLT)
575 
576  .setDescription("Coefficient for the length dependence of DPHIB");
577  p.addPar("PWDPHIB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWDPHIB)
578  .setUnit(U_VOLT)
579 
580  .setDescription("Coefficient for the width dependence of DPHIB");
581  p.addPar("PLWDPHIB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWDPHIB)
582  .setUnit(U_VOLT)
583 
584  .setDescription("Coefficient for the length times width dependence of DPHIB");
585  p.addPar("PODELVTAC", static_cast<double>(0), &ADMSPSP103VA::Model::PODELVTAC)
586  .setUnit(U_VOLT)
587 
588  .setDescription("Coefficient for the geometry independent part of DELVTAC");
589  p.addPar("PLDELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLDELVTAC)
590  .setUnit(U_VOLT)
591 
592  .setDescription("Coefficient for the length dependence of DELVTAC");
593  p.addPar("PWDELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWDELVTAC)
594  .setUnit(U_VOLT)
595 
596  .setDescription("Coefficient for the width dependence of DELVTAC");
597  p.addPar("PLWDELVTAC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWDELVTAC)
598  .setUnit(U_VOLT)
599 
600  .setDescription("Coefficient for the length times width dependence of DELVTAC");
601  p.addPar("PONP", static_cast<double>(1E+26), &ADMSPSP103VA::Model::PONP)
602  .setUnit(U_METERM3)
603 
604  .setDescription("Coefficient for the geometry independent part of NP");
605  p.addPar("PLNP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNP)
606  .setUnit(U_METERM3)
607 
608  .setDescription("Coefficient for the length dependence of NP");
609  p.addPar("PWNP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNP)
610  .setUnit(U_METERM3)
611 
612  .setDescription("Coefficient for the width dependence of NP");
613  p.addPar("PLWNP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNP)
614  .setUnit(U_METERM3)
615 
616  .setDescription("Coefficient for the length times width dependence of NP");
617  p.addPar("POCT", static_cast<double>(0), &ADMSPSP103VA::Model::POCT)
618  .setDescription("Coefficient for the geometry independent part of CT");
619  p.addPar("PLCT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCT)
620  .setDescription("Coefficient for the length dependence of CT");
621  p.addPar("PWCT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCT)
622  .setDescription("Coefficient for the width dependence of CT");
623  p.addPar("PLWCT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCT)
624  .setDescription("Coefficient for the length times width dependence of CT");
625  p.addPar("POTOXOV", static_cast<double>(2E-09), &ADMSPSP103VA::Model::POTOXOV)
626  .setUnit(U_METER)
627 
628  .setDescription("Coefficient for the geometry independent part of TOXOV");
629  p.addPar("POTOXOVD", static_cast<double>(2E-09), &ADMSPSP103VA::Model::POTOXOVD)
630  .setUnit(U_METER)
631 
632  .setDescription("Coefficient for the geometry independent part of TOXOV for drain side");
633  p.addPar("PONOV", static_cast<double>(5E+25), &ADMSPSP103VA::Model::PONOV)
634  .setUnit(U_METERM3)
635 
636  .setDescription("Coefficient for the geometry independent part of NOV");
637  p.addPar("PLNOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNOV)
638  .setUnit(U_METERM3)
639 
640  .setDescription("Coefficient for the length dependence of NOV");
641  p.addPar("PWNOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNOV)
642  .setUnit(U_METERM3)
643 
644  .setDescription("Coefficient for the width dependence of NOV");
645  p.addPar("PLWNOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNOV)
646  .setUnit(U_METERM3)
647 
648  .setDescription("Coefficient for the length times width dependence of NOV");
649  p.addPar("PONOVD", static_cast<double>(5E+25), &ADMSPSP103VA::Model::PONOVD)
650  .setUnit(U_METERM3)
651 
652  .setDescription("Coefficient for the geometry independent part of NOV for drain side");
653  p.addPar("PLNOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNOVD)
654  .setUnit(U_METERM3)
655 
656  .setDescription("Coefficient for the length dependence of NOV for drain side");
657  p.addPar("PWNOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNOVD)
658  .setUnit(U_METERM3)
659 
660  .setDescription("Coefficient for the width dependence of NOV for drain side");
661  p.addPar("PLWNOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNOVD)
662  .setUnit(U_METERM3)
663 
664  .setDescription("Coefficient for the length times width dependence of NOV for drain side");
665  p.addPar("POCF", static_cast<double>(0), &ADMSPSP103VA::Model::POCF)
666  .setDescription("Coefficient for the geometry independent part of CF");
667  p.addPar("PLCF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCF)
668  .setDescription("Coefficient for the length dependence of CF");
669  p.addPar("PWCF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCF)
670  .setDescription("Coefficient for the width dependence of CF");
671  p.addPar("PLWCF", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCF)
672  .setDescription("Coefficient for the length times width dependence of CF");
673  p.addPar("POCFB", static_cast<double>(0), &ADMSPSP103VA::Model::POCFB)
674  .setDescription("Coefficient for the geometry independent part of CFB");
675  p.addPar("POBETN", static_cast<double>(0.07), &ADMSPSP103VA::Model::POBETN)
676  .setDescription("Coefficient for the geometry independent part of BETN");
677  p.addPar("PLBETN", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLBETN)
678  .setDescription("Coefficient for the length dependence of BETN");
679  p.addPar("PWBETN", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWBETN)
680  .setDescription("Coefficient for the width dependence of BETN");
681  p.addPar("PLWBETN", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWBETN)
682  .setDescription("Coefficient for the length times width dependence of BETN");
683  p.addPar("POSTBET", static_cast<double>(1), &ADMSPSP103VA::Model::POSTBET)
684  .setDescription("Coefficient for the geometry independent part of STBET");
685  p.addPar("PLSTBET", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLSTBET)
686  .setDescription("Coefficient for the length dependence of STBET");
687  p.addPar("PWSTBET", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWSTBET)
688  .setDescription("Coefficient for the width dependence of STBET");
689  p.addPar("PLWSTBET", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWSTBET)
690  .setDescription("Coefficient for the length times width dependence of STBET");
691  p.addPar("POMUE", static_cast<double>(0.5), &ADMSPSP103VA::Model::POMUE)
692  .setDescription("Coefficient for the geometry independent part of MUE");
693  p.addPar("PLMUE", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLMUE)
694  .setDescription("Coefficient for the length dependence of MUE");
695  p.addPar("PWMUE", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWMUE)
696  .setDescription("Coefficient for the width dependence of MUE");
697  p.addPar("PLWMUE", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWMUE)
698  .setDescription("Coefficient for the length times width dependence of MUE");
699  p.addPar("POSTMUE", static_cast<double>(0), &ADMSPSP103VA::Model::POSTMUE)
700  .setDescription("Coefficient for the geometry independent part of STMUE");
701  p.addPar("POTHEMU", static_cast<double>(1.5), &ADMSPSP103VA::Model::POTHEMU)
702  .setDescription("Coefficient for the geometry independent part of THEMU");
703  p.addPar("POSTTHEMU", static_cast<double>(1.5), &ADMSPSP103VA::Model::POSTTHEMU)
704  .setDescription("Coefficient for the geometry independent part of STTHEMU");
705  p.addPar("POCS", static_cast<double>(0), &ADMSPSP103VA::Model::POCS)
706  .setDescription("Coefficient for the geometry independent part of CS");
707  p.addPar("PLCS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCS)
708  .setDescription("Coefficient for the length dependence of CS");
709  p.addPar("PWCS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCS)
710  .setDescription("Coefficient for the width dependence of CS");
711  p.addPar("PLWCS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCS)
712  .setDescription("Coefficient for the length times width dependence of CS");
713  p.addPar("POSTCS", static_cast<double>(0), &ADMSPSP103VA::Model::POSTCS)
714  .setDescription("Coefficient for the geometry independent part of STCS");
715  p.addPar("POXCOR", static_cast<double>(0), &ADMSPSP103VA::Model::POXCOR)
716  .setDescription("Coefficient for the geometry independent part of XCOR");
717  p.addPar("PLXCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLXCOR)
718  .setDescription("Coefficient for the length dependence of XCOR");
719  p.addPar("PWXCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWXCOR)
720  .setDescription("Coefficient for the width dependence of XCOR");
721  p.addPar("PLWXCOR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWXCOR)
722  .setDescription("Coefficient for the length times width dependence of XCOR");
723  p.addPar("POSTXCOR", static_cast<double>(0), &ADMSPSP103VA::Model::POSTXCOR)
724  .setDescription("Coefficient for the geometry independent part of STXCOR");
725  p.addPar("POFETA", static_cast<double>(1), &ADMSPSP103VA::Model::POFETA)
726  .setDescription("Coefficient for the geometry independent part of FETA");
727  p.addPar("PORS", static_cast<double>(30), &ADMSPSP103VA::Model::PORS)
728  .setDescription("Coefficient for the geometry independent part of RS");
729  p.addPar("PLRS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLRS)
730  .setDescription("Coefficient for the length dependence of RS");
731  p.addPar("PWRS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWRS)
732  .setDescription("Coefficient for the width dependence of RS");
733  p.addPar("PLWRS", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWRS)
734  .setDescription("Coefficient for the length times width dependence of RS");
735  p.addPar("POSTRS", static_cast<double>(1), &ADMSPSP103VA::Model::POSTRS)
736  .setDescription("Coefficient for the geometry independent part of STRS");
737  p.addPar("PORSB", static_cast<double>(0), &ADMSPSP103VA::Model::PORSB)
738  .setDescription("Coefficient for the geometry independent part of RSB");
739  p.addPar("PORSG", static_cast<double>(0), &ADMSPSP103VA::Model::PORSG)
740  .setDescription("Coefficient for the geometry independent part of RSG");
741  p.addPar("POTHESAT", static_cast<double>(1), &ADMSPSP103VA::Model::POTHESAT)
742  .setDescription("Coefficient for the geometry independent part of THESAT");
743  p.addPar("PLTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLTHESAT)
744  .setDescription("Coefficient for the length dependence of THESAT");
745  p.addPar("PWTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWTHESAT)
746  .setDescription("Coefficient for the width dependence of THESAT");
747  p.addPar("PLWTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWTHESAT)
748  .setDescription("Coefficient for the length times width dependence of THESAT");
749  p.addPar("POSTTHESAT", static_cast<double>(1), &ADMSPSP103VA::Model::POSTTHESAT)
750  .setDescription("Coefficient for the geometry independent part of STTHESAT");
751  p.addPar("PLSTTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLSTTHESAT)
752  .setDescription("Coefficient for the length dependence of STTHESAT");
753  p.addPar("PWSTTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWSTTHESAT)
754  .setDescription("Coefficient for the width dependence of STTHESAT");
755  p.addPar("PLWSTTHESAT", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWSTTHESAT)
756  .setDescription("Coefficient for the length times width dependence of STTHESAT");
757  p.addPar("POTHESATB", static_cast<double>(0), &ADMSPSP103VA::Model::POTHESATB)
758  .setDescription("Coefficient for the geometry independent part of THESATB");
759  p.addPar("PLTHESATB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLTHESATB)
760  .setDescription("Coefficient for the length dependence of THESATB");
761  p.addPar("PWTHESATB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWTHESATB)
762  .setDescription("Coefficient for the width dependence of THESATB");
763  p.addPar("PLWTHESATB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWTHESATB)
764  .setDescription("Coefficient for the length times width dependence of THESATB");
765  p.addPar("POTHESATG", static_cast<double>(0), &ADMSPSP103VA::Model::POTHESATG)
766  .setDescription("Coefficient for the geometry independent part of THESATG");
767  p.addPar("PLTHESATG", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLTHESATG)
768  .setDescription("Coefficient for the length dependence of THESATG");
769  p.addPar("PWTHESATG", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWTHESATG)
770  .setDescription("Coefficient for the width dependence of THESATG");
771  p.addPar("PLWTHESATG", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWTHESATG)
772  .setDescription("Coefficient for the length times width dependence of THESATG");
773  p.addPar("POAX", static_cast<double>(3), &ADMSPSP103VA::Model::POAX)
774  .setDescription("Coefficient for the geometry independent part of AX");
775  p.addPar("PLAX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLAX)
776  .setDescription("Coefficient for the length dependence of AX");
777  p.addPar("PWAX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWAX)
778  .setDescription("Coefficient for the width dependence of AX");
779  p.addPar("PLWAX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWAX)
780  .setDescription("Coefficient for the length times width dependence of AX");
781  p.addPar("POALP", static_cast<double>(0.01), &ADMSPSP103VA::Model::POALP)
782  .setDescription("Coefficient for the geometry independent part of ALP");
783  p.addPar("PLALP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLALP)
784  .setDescription("Coefficient for the length dependence of ALP");
785  p.addPar("PWALP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWALP)
786  .setDescription("Coefficient for the width dependence of ALP");
787  p.addPar("PLWALP", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWALP)
788  .setDescription("Coefficient for the length times width dependence of ALP");
789  p.addPar("POALP1", static_cast<double>(0), &ADMSPSP103VA::Model::POALP1)
790  .setUnit(U_VOLT)
791 
792  .setDescription("Coefficient for the geometry independent part of ALP1");
793  p.addPar("PLALP1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLALP1)
794  .setUnit(U_VOLT)
795 
796  .setDescription("Coefficient for the length dependence of ALP1");
797  p.addPar("PWALP1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWALP1)
798  .setUnit(U_VOLT)
799 
800  .setDescription("Coefficient for the width dependence of ALP1");
801  p.addPar("PLWALP1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWALP1)
802  .setUnit(U_VOLT)
803 
804  .setDescription("Coefficient for the length times width dependence of ALP1");
805  p.addPar("POALP2", static_cast<double>(0), &ADMSPSP103VA::Model::POALP2)
806  .setDescription("Coefficient for the geometry independent part of ALP2");
807  p.addPar("PLALP2", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLALP2)
808  .setDescription("Coefficient for the length dependence of ALP2");
809  p.addPar("PWALP2", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWALP2)
810  .setDescription("Coefficient for the width dependence of ALP2");
811  p.addPar("PLWALP2", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWALP2)
812  .setDescription("Coefficient for the length times width dependence of ALP2");
813  p.addPar("POVP", static_cast<double>(0.05), &ADMSPSP103VA::Model::POVP)
814  .setUnit(U_VOLT)
815 
816  .setDescription("Coefficient for the geometry independent part of VP");
817  p.addPar("POA1", static_cast<double>(1), &ADMSPSP103VA::Model::POA1)
818  .setDescription("Coefficient for the geometry independent part of A1");
819  p.addPar("PLA1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLA1)
820  .setDescription("Coefficient for the length dependence of A1");
821  p.addPar("PWA1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWA1)
822  .setDescription("Coefficient for the width dependence of A1");
823  p.addPar("PLWA1", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWA1)
824  .setDescription("Coefficient for the length times width dependence of A1");
825  p.addPar("POA2", static_cast<double>(10), &ADMSPSP103VA::Model::POA2)
826  .setUnit(U_VOLT)
827 
828  .setDescription("Coefficient for the geometry independent part of A2");
829  p.addPar("POSTA2", static_cast<double>(0), &ADMSPSP103VA::Model::POSTA2)
830  .setUnit(U_VOLT)
831 
832  .setDescription("Coefficient for the geometry independent part of STA2");
833  p.addPar("POA3", static_cast<double>(1), &ADMSPSP103VA::Model::POA3)
834  .setDescription("Coefficient for the geometry independent part of A3");
835  p.addPar("PLA3", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLA3)
836  .setDescription("Coefficient for the length dependence of A3");
837  p.addPar("PWA3", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWA3)
838  .setDescription("Coefficient for the width dependence of A3");
839  p.addPar("PLWA3", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWA3)
840  .setDescription("Coefficient for the length times width dependence of A3");
841  p.addPar("POA4", static_cast<double>(0), &ADMSPSP103VA::Model::POA4)
842  .setDescription("Coefficient for the geometry independent part of A4");
843  p.addPar("PLA4", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLA4)
844  .setDescription("Coefficient for the length dependence of A4");
845  p.addPar("PWA4", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWA4)
846  .setDescription("Coefficient for the width dependence of A4");
847  p.addPar("PLWA4", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWA4)
848  .setDescription("Coefficient for the length times width dependence of A4");
849  p.addPar("POGCO", static_cast<double>(0), &ADMSPSP103VA::Model::POGCO)
850  .setDescription("Coefficient for the geometry independent part of GCO");
851  p.addPar("POIGINV", static_cast<double>(0), &ADMSPSP103VA::Model::POIGINV)
852  .setUnit(U_AMP)
853 
854  .setDescription("Coefficient for the geometry independent part of IGINV");
855  p.addPar("PLIGINV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLIGINV)
856  .setUnit(U_AMP)
857 
858  .setDescription("Coefficient for the length dependence of IGINV");
859  p.addPar("PWIGINV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWIGINV)
860  .setUnit(U_AMP)
861 
862  .setDescription("Coefficient for the width dependence of IGINV");
863  p.addPar("PLWIGINV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWIGINV)
864  .setUnit(U_AMP)
865 
866  .setDescription("Coefficient for the length times width dependence of IGINV");
867  p.addPar("POIGOV", static_cast<double>(0), &ADMSPSP103VA::Model::POIGOV)
868  .setUnit(U_AMP)
869 
870  .setDescription("Coefficient for the geometry independent part of IGOV");
871  p.addPar("PLIGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLIGOV)
872  .setUnit(U_AMP)
873 
874  .setDescription("Coefficient for the length dependence of IGOV");
875  p.addPar("PWIGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWIGOV)
876  .setUnit(U_AMP)
877 
878  .setDescription("Coefficient for the width dependence of IGOV");
879  p.addPar("PLWIGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWIGOV)
880  .setUnit(U_AMP)
881 
882  .setDescription("Coefficient for the length times width dependence of IGOV");
883  p.addPar("POIGOVD", static_cast<double>(0), &ADMSPSP103VA::Model::POIGOVD)
884  .setUnit(U_AMP)
885 
886  .setDescription("Coefficient for the geometry independent part of IGOV for drain side");
887  p.addPar("PLIGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLIGOVD)
888  .setUnit(U_AMP)
889 
890  .setDescription("Coefficient for the length dependence of IGOV for drain side");
891  p.addPar("PWIGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWIGOVD)
892  .setUnit(U_AMP)
893 
894  .setDescription("Coefficient for the width dependence of IGOV for drain side");
895  p.addPar("PLWIGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWIGOVD)
896  .setUnit(U_AMP)
897 
898  .setDescription("Coefficient for the length times width dependence of IGOV for drain side");
899  p.addPar("POSTIG", static_cast<double>(2), &ADMSPSP103VA::Model::POSTIG)
900  .setDescription("Coefficient for the geometry independent part of STIG");
901  p.addPar("POGC2", static_cast<double>(0.375), &ADMSPSP103VA::Model::POGC2)
902  .setDescription("Coefficient for the geometry independent part of GC2");
903  p.addPar("POGC3", static_cast<double>(0.063), &ADMSPSP103VA::Model::POGC3)
904  .setDescription("Coefficient for the geometry independent part of GC3");
905  p.addPar("POCHIB", static_cast<double>(3.1), &ADMSPSP103VA::Model::POCHIB)
906  .setUnit(U_VOLT)
907 
908  .setDescription("Coefficient for the geometry independent part of CHIB");
909  p.addPar("POAGIDL", static_cast<double>(0), &ADMSPSP103VA::Model::POAGIDL)
910  .setUnit(U_AMPVM3)
911 
912  .setDescription("Coefficient for the geometry independent part of AGIDL");
913  p.addPar("PLAGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLAGIDL)
914  .setUnit(U_AMPVM3)
915 
916  .setDescription("Coefficient for the length dependence of AGIDL");
917  p.addPar("PWAGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWAGIDL)
918  .setUnit(U_AMPVM3)
919 
920  .setDescription("Coefficient for the width dependence of AGIDL");
921  p.addPar("PLWAGIDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWAGIDL)
922  .setUnit(U_AMPVM3)
923 
924  .setDescription("Coefficient for the length times width dependence of AGIDL");
925  p.addPar("POAGIDLD", static_cast<double>(0), &ADMSPSP103VA::Model::POAGIDLD)
926  .setUnit(U_AMPVM3)
927 
928  .setDescription("Coefficient for the geometry independent part of AGIDL for drain side");
929  p.addPar("PLAGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLAGIDLD)
930  .setUnit(U_AMPVM3)
931 
932  .setDescription("Coefficient for the length dependence of AGIDL for drain side");
933  p.addPar("PWAGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWAGIDLD)
934  .setUnit(U_AMPVM3)
935 
936  .setDescription("Coefficient for the width dependence of AGIDL for drain side");
937  p.addPar("PLWAGIDLD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWAGIDLD)
938  .setUnit(U_AMPVM3)
939 
940  .setDescription("Coefficient for the length times width dependence of AGIDL for drain side");
941  p.addPar("POBGIDL", static_cast<double>(41), &ADMSPSP103VA::Model::POBGIDL)
942  .setUnit(U_VOLT)
943 
944  .setDescription("Coefficient for the geometry independent part of BGIDL");
945  p.addPar("POBGIDLD", static_cast<double>(41), &ADMSPSP103VA::Model::POBGIDLD)
946  .setUnit(U_VOLT)
947 
948  .setDescription("Coefficient for the geometry independent part of BGIDL for drain side");
949  p.addPar("POSTBGIDL", static_cast<double>(0), &ADMSPSP103VA::Model::POSTBGIDL)
950  .setUnit(U_VKM1)
951 
952  .setDescription("Coefficient for the geometry independent part of STBGIDL");
953  p.addPar("POSTBGIDLD", static_cast<double>(0), &ADMSPSP103VA::Model::POSTBGIDLD)
954  .setUnit(U_VKM1)
955 
956  .setDescription("Coefficient for the geometry independent part of STBGIDL for drain side");
957  p.addPar("POCGIDL", static_cast<double>(0), &ADMSPSP103VA::Model::POCGIDL)
958  .setDescription("Coefficient for the geometry independent part of CGIDL");
959  p.addPar("POCGIDLD", static_cast<double>(0), &ADMSPSP103VA::Model::POCGIDLD)
960  .setDescription("Coefficient for the geometry independent part of CGIDL for drain side");
961  p.addPar("POCOX", static_cast<double>(1E-14), &ADMSPSP103VA::Model::POCOX)
962  .setUnit(U_FARAD)
963 
964  .setDescription("Coefficient for the geometry independent part of COX");
965  p.addPar("PLCOX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCOX)
966  .setUnit(U_FARAD)
967 
968  .setDescription("Coefficient for the length dependence of COX");
969  p.addPar("PWCOX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCOX)
970  .setUnit(U_FARAD)
971 
972  .setDescription("Coefficient for the width dependence of COX");
973  p.addPar("PLWCOX", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCOX)
974  .setUnit(U_FARAD)
975 
976  .setDescription("Coefficient for the length times width dependence of COX");
977  p.addPar("POCGOV", static_cast<double>(1E-15), &ADMSPSP103VA::Model::POCGOV)
978  .setUnit(U_FARAD)
979 
980  .setDescription("Coefficient for the geometry independent part of CGOV");
981  p.addPar("PLCGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCGOV)
982  .setUnit(U_FARAD)
983 
984  .setDescription("Coefficient for the length dependence of CGOV");
985  p.addPar("PWCGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCGOV)
986  .setUnit(U_FARAD)
987 
988  .setDescription("Coefficient for the width dependence of CGOV");
989  p.addPar("PLWCGOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCGOV)
990  .setUnit(U_FARAD)
991 
992  .setDescription("Coefficient for the length times width dependence of CGOV");
993  p.addPar("POCGOVD", static_cast<double>(1E-15), &ADMSPSP103VA::Model::POCGOVD)
994  .setUnit(U_FARAD)
995 
996  .setDescription("Coefficient for the geometry independent part of CGOV for drain side");
997  p.addPar("PLCGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCGOVD)
998  .setUnit(U_FARAD)
999 
1000  .setDescription("Coefficient for the length dependence of CGOV for drain side");
1001  p.addPar("PWCGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCGOVD)
1002  .setUnit(U_FARAD)
1003 
1004  .setDescription("Coefficient for the width dependence of CGOV for drain side");
1005  p.addPar("PLWCGOVD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCGOVD)
1006  .setUnit(U_FARAD)
1007 
1008  .setDescription("Coefficient for the length times width dependence of CGOV for drain side");
1009  p.addPar("POCGBOV", static_cast<double>(0), &ADMSPSP103VA::Model::POCGBOV)
1010  .setUnit(U_FARAD)
1011 
1012  .setDescription("Coefficient for the geometry independent part of CGBOV");
1013  p.addPar("PLCGBOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCGBOV)
1014  .setUnit(U_FARAD)
1015 
1016  .setDescription("Coefficient for the length dependence of CGBOV");
1017  p.addPar("PWCGBOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCGBOV)
1018  .setUnit(U_FARAD)
1019 
1020  .setDescription("Coefficient for the width dependence of CGBOV");
1021  p.addPar("PLWCGBOV", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCGBOV)
1022  .setUnit(U_FARAD)
1023 
1024  .setDescription("Coefficient for the length times width dependence of CGBOV");
1025  p.addPar("POCFR", static_cast<double>(0), &ADMSPSP103VA::Model::POCFR)
1026  .setUnit(U_FARAD)
1027 
1028  .setDescription("Coefficient for the geometry independent part of CFR");
1029  p.addPar("PLCFR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCFR)
1030  .setUnit(U_FARAD)
1031 
1032  .setDescription("Coefficient for the length dependence of CFR");
1033  p.addPar("PWCFR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCFR)
1034  .setUnit(U_FARAD)
1035 
1036  .setDescription("Coefficient for the width dependence of CFR");
1037  p.addPar("PLWCFR", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCFR)
1038  .setUnit(U_FARAD)
1039 
1040  .setDescription("Coefficient for the length times width dependence of CFR");
1041  p.addPar("POCFRD", static_cast<double>(0), &ADMSPSP103VA::Model::POCFRD)
1042  .setUnit(U_FARAD)
1043 
1044  .setDescription("Coefficient for the geometry independent part of CFR for drain side");
1045  p.addPar("PLCFRD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLCFRD)
1046  .setUnit(U_FARAD)
1047 
1048  .setDescription("Coefficient for the length dependence of CFR for drain side");
1049  p.addPar("PWCFRD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWCFRD)
1050  .setUnit(U_FARAD)
1051 
1052  .setDescription("Coefficient for the width dependence of CFR for drain side");
1053  p.addPar("PLWCFRD", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWCFRD)
1054  .setUnit(U_FARAD)
1055 
1056  .setDescription("Coefficient for the length times width dependence of CFR for drain side");
1057  p.addPar("POFNT", static_cast<double>(1), &ADMSPSP103VA::Model::POFNT)
1058  .setDescription("Coefficient for the geometry independent part of FNT");
1059  p.addPar("PONFA", static_cast<double>(8E+22), &ADMSPSP103VA::Model::PONFA)
1060  .setDescription("Coefficient for the geometry independent part of NFA");
1061  p.addPar("PLNFA", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNFA)
1062  .setDescription("Coefficient for the length dependence of NFA");
1063  p.addPar("PWNFA", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNFA)
1064  .setDescription("Coefficient for the width dependence of NFA");
1065  p.addPar("PLWNFA", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNFA)
1066  .setDescription("Coefficient for the length times width dependence of NFA");
1067  p.addPar("PONFB", static_cast<double>(3E+07), &ADMSPSP103VA::Model::PONFB)
1068  .setDescription("Coefficient for the geometry independent part of NFB");
1069  p.addPar("PLNFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNFB)
1070  .setDescription("Coefficient for the length dependence of NFB");
1071  p.addPar("PWNFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNFB)
1072  .setDescription("Coefficient for the width dependence of NFB");
1073  p.addPar("PLWNFB", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNFB)
1074  .setDescription("Coefficient for the length times width dependence of NFB");
1075  p.addPar("PONFC", static_cast<double>(0), &ADMSPSP103VA::Model::PONFC)
1076  .setDescription("Coefficient for the geometry independent part of NFC");
1077  p.addPar("PLNFC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLNFC)
1078  .setDescription("Coefficient for the length dependence of NFC");
1079  p.addPar("PWNFC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PWNFC)
1080  .setDescription("Coefficient for the width dependence of NFC");
1081  p.addPar("PLWNFC", static_cast<double>(0.0), &ADMSPSP103VA::Model::PLWNFC)
1082  .setDescription("Coefficient for the length times width dependence of NFC");
1083  p.addPar("POEF", static_cast<double>(1.0), &ADMSPSP103VA::Model::POEF)
1084  .setDescription("Coefficient for the flicker noise frequency exponent");
1085  p.addPar("POKVTHOWE", static_cast<double>(0), &ADMSPSP103VA::Model::POKVTHOWE)
1086  .setDescription("Coefficient for the geometry independent part of KVTHOWE");
1087  p.addPar("PLKVTHOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PLKVTHOWE)
1088  .setDescription("Coefficient for the length dependence part of KVTHOWE");
1089  p.addPar("PWKVTHOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PWKVTHOWE)
1090  .setDescription("Coefficient for the width dependence part of KVTHOWE");
1091  p.addPar("PLWKVTHOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PLWKVTHOWE)
1092  .setDescription("Coefficient for the length times width dependence part of KVTHOWE");
1093  p.addPar("POKUOWE", static_cast<double>(0), &ADMSPSP103VA::Model::POKUOWE)
1094  .setDescription("Coefficient for the geometry independent part of KUOWE");
1095  p.addPar("PLKUOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PLKUOWE)
1096  .setDescription("Coefficient for the length dependence part of KUOWE");
1097  p.addPar("PWKUOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PWKUOWE)
1098  .setDescription("Coefficient for the width dependence part of KUOWE");
1099  p.addPar("PLWKUOWE", static_cast<double>(0), &ADMSPSP103VA::Model::PLWKUOWE)
1100  .setDescription("Coefficient for the length times width dependence part of KUOWE");
1101  p.addPar("LMIN", static_cast<double>(0), &ADMSPSP103VA::Model::LMIN)
1102  .setUnit(U_METER)
1103 
1104  .setDescription("Dummy parameter to label binning set");
1105  p.addPar("LMAX", static_cast<double>(1.0), &ADMSPSP103VA::Model::LMAX)
1106  .setUnit(U_METER)
1107 
1108  .setDescription("Dummy parameter to label binning set");
1109  p.addPar("WMIN", static_cast<double>(0), &ADMSPSP103VA::Model::WMIN)
1110  .setUnit(U_METER)
1111 
1112  .setDescription("Dummy parameter to label binning set");
1113  p.addPar("WMAX", static_cast<double>(1.0), &ADMSPSP103VA::Model::WMAX)
1114  .setUnit(U_METER)
1115 
1116  .setDescription("Dummy parameter to label binning set");
1117  p.addPar("LVARO", static_cast<double>(0.0), &ADMSPSP103VA::Model::LVARO)
1118  .setUnit(U_METER)
1119 
1120  .setDescription("Geom. independent difference between actual and programmed gate length");
1121  p.addPar("LVARL", static_cast<double>(0.0), &ADMSPSP103VA::Model::LVARL)
1122  .setDescription("Length dependence of LVAR");
1123  p.addPar("LVARW", static_cast<double>(0.0), &ADMSPSP103VA::Model::LVARW)
1124  .setDescription("Width dependence of LVAR");
1125  p.addPar("LAP", static_cast<double>(0.0), &ADMSPSP103VA::Model::LAP)
1126  .setUnit(U_METER)
1127 
1128  .setDescription("Effective channel length reduction per side");
1129  p.addPar("WVARO", static_cast<double>(0.0), &ADMSPSP103VA::Model::WVARO)
1130  .setUnit(U_METER)
1131 
1132  .setDescription("Geom. independent difference between actual and programmed field-oxide opening");
1133  p.addPar("WVARL", static_cast<double>(0.0), &ADMSPSP103VA::Model::WVARL)
1134  .setDescription("Length dependence of WVAR");
1135  p.addPar("WVARW", static_cast<double>(0.0), &ADMSPSP103VA::Model::WVARW)
1136  .setDescription("Width dependence of WVAR");
1137  p.addPar("WOT", static_cast<double>(0.0), &ADMSPSP103VA::Model::WOT)
1138  .setUnit(U_METER)
1139 
1140  .setDescription("Effective channel width reduction per side");
1141  p.addPar("DLQ", static_cast<double>(0.0), &ADMSPSP103VA::Model::DLQ)
1142  .setUnit(U_METER)
1143 
1144  .setDescription("Effective channel length reduction for CV");
1145  p.addPar("DWQ", static_cast<double>(0.0), &ADMSPSP103VA::Model::DWQ)
1146  .setUnit(U_METER)
1147 
1148  .setDescription("Effective channel width reduction for CV");
1149  p.addPar("VFBO", static_cast<double>((-1.0)), &ADMSPSP103VA::Model::VFBO)
1150  .setUnit(U_VOLT)
1151 
1152  .setDescription("Geometry-independent flat-band voltage at TR");
1153  p.addPar("VFBL", static_cast<double>(0.0), &ADMSPSP103VA::Model::VFBL)
1154  .setUnit(U_VOLT)
1155 
1156  .setDescription("Length dependence of flat-band voltage");
1157  p.addPar("VFBW", static_cast<double>(0.0), &ADMSPSP103VA::Model::VFBW)
1158  .setUnit(U_VOLT)
1159 
1160  .setDescription("Width dependence of flat-band voltage");
1161  p.addPar("VFBLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::VFBLW)
1162  .setUnit(U_VOLT)
1163 
1164  .setDescription("Area dependence of flat-band voltage");
1165  p.addPar("STVFBO", static_cast<double>(5e-4), &ADMSPSP103VA::Model::STVFBO)
1166  .setUnit(U_VKM1)
1167 
1168  .setDescription("Geometry-independent temperature dependence of VFB");
1169  p.addPar("STVFBL", static_cast<double>(0.0), &ADMSPSP103VA::Model::STVFBL)
1170  .setUnit(U_VKM1)
1171 
1172  .setDescription("Length dependence of temperature dependence of VFB");
1173  p.addPar("STVFBW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STVFBW)
1174  .setUnit(U_VKM1)
1175 
1176  .setDescription("Width dependence of temperature dependence of VFB");
1177  p.addPar("STVFBLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STVFBLW)
1178  .setUnit(U_VKM1)
1179 
1180  .setDescription("Area dependence of temperature dependence of VFB");
1181  p.addPar("TOXO", static_cast<double>(2e-9), &ADMSPSP103VA::Model::TOXO)
1182  .setUnit(U_METER)
1183 
1184  .setDescription("Gate oxide thickness");
1185  p.addPar("EPSROXO", static_cast<double>(3.9), &ADMSPSP103VA::Model::EPSROXO)
1186  .setDescription("Relative permittivity of gate dielectric");
1187  p.addPar("NSUBO", static_cast<double>(3e23), &ADMSPSP103VA::Model::NSUBO)
1188  .setUnit(U_METERM3)
1189 
1190  .setDescription("Geometry independent substrate doping");
1191  p.addPar("NSUBW", static_cast<double>(0.0), &ADMSPSP103VA::Model::NSUBW)
1192  .setDescription("Width dependence of background doping NSUBO due to segregation");
1193  p.addPar("WSEG", static_cast<double>(1e-8), &ADMSPSP103VA::Model::WSEG)
1194  .setUnit(U_METER)
1195 
1196  .setDescription("Char. length of segregation of background doping NSUBO");
1197  p.addPar("NPCK", static_cast<double>(1e24), &ADMSPSP103VA::Model::NPCK)
1198  .setUnit(U_METERM3)
1199 
1200  .setDescription("Pocket doping level");
1201  p.addPar("NPCKW", static_cast<double>(0.0), &ADMSPSP103VA::Model::NPCKW)
1202  .setDescription("Width dependence of pocket doping NPCK due to segregation");
1203  p.addPar("WSEGP", static_cast<double>(1e-8), &ADMSPSP103VA::Model::WSEGP)
1204  .setUnit(U_METER)
1205 
1206  .setDescription("Char. length of segregation of pocket doping NPCK");
1207  p.addPar("LPCK", static_cast<double>(1e-8), &ADMSPSP103VA::Model::LPCK)
1208  .setUnit(U_METER)
1209 
1210  .setDescription("Char. length of lateral doping profile");
1211  p.addPar("LPCKW", static_cast<double>(0.0), &ADMSPSP103VA::Model::LPCKW)
1212  .setDescription("Width dependence of char. length of lateral doping profile");
1213  p.addPar("FOL1", static_cast<double>(0.0), &ADMSPSP103VA::Model::FOL1)
1214  .setDescription("First length dependence coefficient for short channel body effect");
1215  p.addPar("FOL2", static_cast<double>(0.0), &ADMSPSP103VA::Model::FOL2)
1216  .setDescription("Second length dependence coefficient for short channel body effect");
1217  p.addPar("FACNEFFACO", static_cast<double>(1.0), &ADMSPSP103VA::Model::FACNEFFACO)
1218  .setDescription("Geom. independent pre-factor for effective substrate doping in separate charge calculation");
1219  p.addPar("FACNEFFACL", static_cast<double>(0.0), &ADMSPSP103VA::Model::FACNEFFACL)
1220  .setDescription("Length dependence of FACNEFFAC");
1221  p.addPar("FACNEFFACW", static_cast<double>(0.0), &ADMSPSP103VA::Model::FACNEFFACW)
1222  .setDescription("Width dependence of FACNEFFAC");
1223  p.addPar("FACNEFFACLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::FACNEFFACLW)
1224  .setDescription("Area dependence of FACNEFFAC");
1225  p.addPar("GFACNUDO", static_cast<double>(1.0), &ADMSPSP103VA::Model::GFACNUDO)
1226  .setDescription("Geom. independent bodyfactor change due to NUD-effect");
1227  p.addPar("GFACNUDL", static_cast<double>(0.0), &ADMSPSP103VA::Model::GFACNUDL)
1228  .setDescription("Length dependence of GFACNUD");
1229  p.addPar("GFACNUDLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::GFACNUDLEXP)
1230  .setDescription("Exponent for length dependence of GFACNUD");
1231  p.addPar("GFACNUDW", static_cast<double>(0.0), &ADMSPSP103VA::Model::GFACNUDW)
1232  .setDescription("Width dependence of GFACNUD");
1233  p.addPar("GFACNUDLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::GFACNUDLW)
1234  .setDescription("Area dependence of GFACNUD");
1235  p.addPar("VSBNUDO", static_cast<double>(0.0), &ADMSPSP103VA::Model::VSBNUDO)
1236  .setUnit(U_VOLT)
1237 
1238  .setDescription("Lower Vsb value for NUD-effect");
1239  p.addPar("DVSBNUDO", static_cast<double>(1.0), &ADMSPSP103VA::Model::DVSBNUDO)
1240  .setUnit(U_VOLT)
1241 
1242  .setDescription("Vsb range for NUD-effect");
1243  p.addPar("VNSUBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::VNSUBO)
1244  .setUnit(U_VOLT)
1245 
1246  .setDescription("Effective doping bias-dependence parameter");
1247  p.addPar("NSLPO", static_cast<double>(0.05), &ADMSPSP103VA::Model::NSLPO)
1248  .setUnit(U_VOLT)
1249 
1250  .setDescription("Effective doping bias-dependence parameter");
1251  p.addPar("DNSUBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::DNSUBO)
1252  .setUnit(U_VOLTM1)
1253 
1254  .setDescription("Effective doping bias-dependence parameter");
1255  p.addPar("DPHIBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIBO)
1256  .setUnit(U_VOLT)
1257 
1258  .setDescription("Geometry independent offset of PHIB");
1259  p.addPar("DPHIBL", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIBL)
1260  .setUnit(U_VOLT)
1261 
1262  .setDescription("Length dependence offset of PHIB");
1263  p.addPar("DPHIBLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::DPHIBLEXP)
1264  .setDescription("Exponent for length dependence of offset of PHIB");
1265  p.addPar("DPHIBW", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIBW)
1266  .setUnit(U_VOLT)
1267 
1268  .setDescription("Width dependence of offset of PHIB");
1269  p.addPar("DPHIBLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::DPHIBLW)
1270  .setUnit(U_VOLT)
1271 
1272  .setDescription("Area dependence of offset of PHIB");
1273  p.addPar("DELVTACO", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTACO)
1274  .setUnit(U_VOLT)
1275 
1276  .setDescription("Geom. independent offset parameter for PHIB in separate charge calculation");
1277  p.addPar("DELVTACL", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTACL)
1278  .setUnit(U_VOLT)
1279 
1280  .setDescription("Length dependence of DELVTAC");
1281  p.addPar("DELVTACLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::DELVTACLEXP)
1282  .setDescription("Exponent for length dependence of offset of DELVTAC");
1283  p.addPar("DELVTACW", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTACW)
1284  .setUnit(U_VOLT)
1285 
1286  .setDescription("Width dependence of DELVTAC");
1287  p.addPar("DELVTACLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::DELVTACLW)
1288  .setUnit(U_VOLT)
1289 
1290  .setDescription("Area dependence of DELVTAC");
1291  p.addPar("NPO", static_cast<double>(1e26), &ADMSPSP103VA::Model::NPO)
1292  .setUnit(U_METERM3)
1293 
1294  .setDescription("Geometry-independent gate poly-silicon doping");
1295  p.addPar("NPL", static_cast<double>(0.0), &ADMSPSP103VA::Model::NPL)
1296  .setDescription("Length dependence of gate poly-silicon doping");
1297  p.addPar("CTO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CTO)
1298  .setDescription("Geometry-independent interface states factor");
1299  p.addPar("CTL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CTL)
1300  .setDescription("Length dependence of interface states factor");
1301  p.addPar("CTLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::CTLEXP)
1302  .setDescription("Exponent for length dependence of interface states factor");
1303  p.addPar("CTW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CTW)
1304  .setDescription("Width dependence of interface states factor");
1305  p.addPar("CTLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CTLW)
1306  .setDescription("Area dependence of interface states factor");
1307  p.addPar("TOXOVO", static_cast<double>(2e-9), &ADMSPSP103VA::Model::TOXOVO)
1308  .setUnit(U_METER)
1309 
1310  .setDescription("Overlap oxide thickness");
1311  p.addPar("TOXOVDO", static_cast<double>(2e-9), &ADMSPSP103VA::Model::TOXOVDO)
1312  .setUnit(U_METER)
1313 
1314  .setDescription("Overlap oxide thickness for drain side");
1315  p.addPar("LOV", static_cast<double>(0), &ADMSPSP103VA::Model::LOV)
1316  .setUnit(U_METER)
1317 
1318  .setDescription("Overlap length for gate/drain and gate/source overlap capacitance");
1319  p.addPar("LOVD", static_cast<double>(0), &ADMSPSP103VA::Model::LOVD)
1320  .setUnit(U_METER)
1321 
1322  .setDescription("Overlap length for gate/drain overlap capacitance");
1323  p.addPar("NOVO", static_cast<double>(5e25), &ADMSPSP103VA::Model::NOVO)
1324  .setUnit(U_METERM3)
1325 
1326  .setDescription("Effective doping of overlap region");
1327  p.addPar("NOVDO", static_cast<double>(5e25), &ADMSPSP103VA::Model::NOVDO)
1328  .setUnit(U_METERM3)
1329 
1330  .setDescription("Effective doping of overlap region for drain side");
1331  p.addPar("CFL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFL)
1332  .setDescription("Length dependence of DIBL-parameter");
1333  p.addPar("CFLEXP", static_cast<double>(2.0), &ADMSPSP103VA::Model::CFLEXP)
1334  .setDescription("Exponent for length dependence of CF");
1335  p.addPar("CFW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFW)
1336  .setDescription("Width dependence of CF");
1337  p.addPar("CFBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFBO)
1338  .setUnit(U_VOLTM1)
1339 
1340  .setDescription("Back-bias dependence of CF");
1341  p.addPar("UO", static_cast<double>(5e-2), &ADMSPSP103VA::Model::UO)
1342  .setUnit(U_M2VM1SM1)
1343 
1344  .setDescription("Zero-field mobility at TR");
1345  p.addPar("FBET1", static_cast<double>(0.0), &ADMSPSP103VA::Model::FBET1)
1346  .setDescription("Relative mobility decrease due to first lateral profile");
1347  p.addPar("FBET1W", static_cast<double>(0.0), &ADMSPSP103VA::Model::FBET1W)
1348  .setDescription("Width dependence of relative mobility decrease due to first lateral profile");
1349  p.addPar("LP1", static_cast<double>(1e-8), &ADMSPSP103VA::Model::LP1)
1350  .setUnit(U_METER)
1351 
1352  .setDescription("Mobility-related characteristic length of first lateral profile");
1353  p.addPar("LP1W", static_cast<double>(0.0), &ADMSPSP103VA::Model::LP1W)
1354  .setDescription("Width dependence of mobility-related characteristic length of first lateral profile");
1355  p.addPar("FBET2", static_cast<double>(0.0), &ADMSPSP103VA::Model::FBET2)
1356  .setDescription("Relative mobility decrease due to second lateral profile");
1357  p.addPar("LP2", static_cast<double>(1e-8), &ADMSPSP103VA::Model::LP2)
1358  .setUnit(U_METER)
1359 
1360  .setDescription("Mobility-related characteristic length of second lateral profile");
1361  p.addPar("BETW1", static_cast<double>(0.0), &ADMSPSP103VA::Model::BETW1)
1362  .setDescription("First higher-order width scaling coefficient of BETN");
1363  p.addPar("BETW2", static_cast<double>(0.0), &ADMSPSP103VA::Model::BETW2)
1364  .setDescription("Second higher-order width scaling coefficient of BETN");
1365  p.addPar("WBET", static_cast<double>(1e-9), &ADMSPSP103VA::Model::WBET)
1366  .setUnit(U_METER)
1367 
1368  .setDescription("Characteristic width for width scaling of BETN");
1369  p.addPar("STBETO", static_cast<double>(1.0), &ADMSPSP103VA::Model::STBETO)
1370  .setDescription("Geometry independent temperature dependence of BETN");
1371  p.addPar("STBETL", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBETL)
1372  .setDescription("Length dependence of temperature dependence of BETN");
1373  p.addPar("STBETW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBETW)
1374  .setDescription("Width dependence of temperature dependence of BETN");
1375  p.addPar("STBETLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBETLW)
1376  .setDescription("Area dependence of temperature dependence of BETN");
1377  p.addPar("MUEO", static_cast<double>(0.5), &ADMSPSP103VA::Model::MUEO)
1378  .setUnit(U_MVM1)
1379 
1380  .setDescription("Geometry independent mobility reduction coefficient at TR");
1381  p.addPar("MUEW", static_cast<double>(0.0), &ADMSPSP103VA::Model::MUEW)
1382  .setDescription("Width dependence of mobility reduction coefficient at TR");
1383  p.addPar("STMUEO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STMUEO)
1384  .setDescription("Temperature dependence of MUE");
1385  p.addPar("THEMUO", static_cast<double>(1.5), &ADMSPSP103VA::Model::THEMUO)
1386  .setDescription("Mobility reduction exponent at TR");
1387  p.addPar("STTHEMUO", static_cast<double>(1.5), &ADMSPSP103VA::Model::STTHEMUO)
1388  .setDescription("Temperature dependence of THEMU");
1389  p.addPar("CSO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CSO)
1390  .setDescription("Geometry independent coulomb scattering parameter at TR");
1391  p.addPar("CSL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CSL)
1392  .setDescription("Length dependence of CS");
1393  p.addPar("CSLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::CSLEXP)
1394  .setDescription("Exponent for length dependence of CS");
1395  p.addPar("CSW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CSW)
1396  .setDescription("Width dependence of CS");
1397  p.addPar("CSLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CSLW)
1398  .setDescription("Area dependence of CS");
1399  p.addPar("STCSO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STCSO)
1400  .setDescription("Temperature dependence of CS");
1401  p.addPar("XCORO", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCORO)
1402  .setUnit(U_VOLTM1)
1403 
1404  .setDescription("Geometry independent non-universality parameter");
1405  p.addPar("XCORL", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCORL)
1406  .setDescription("Length dependence of non-universality parameter");
1407  p.addPar("XCORW", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCORW)
1408  .setDescription("Width dependence of non-universality parameter");
1409  p.addPar("XCORLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::XCORLW)
1410  .setDescription("Area dependence of non-universality parameter");
1411  p.addPar("STXCORO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STXCORO)
1412  .setDescription("Temperature dependence of XCOR");
1413  p.addPar("FETAO", static_cast<double>(1.0), &ADMSPSP103VA::Model::FETAO)
1414  .setDescription("Effective field parameter");
1415  p.addPar("RSW1", static_cast<double>(50.0), &ADMSPSP103VA::Model::RSW1)
1416  .setUnit(U_OHM)
1417 
1418  .setDescription("Source/drain series resistance for 1 um wide channel at TR");
1419  p.addPar("RSW2", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSW2)
1420  .setDescription("Higher-order width scaling of RS");
1421  p.addPar("STRSO", static_cast<double>(1.0), &ADMSPSP103VA::Model::STRSO)
1422  .setDescription("Temperature dependence of RS");
1423  p.addPar("RSBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSBO)
1424  .setUnit(U_VOLTM1)
1425 
1426  .setDescription("Back-bias dependence of series resistance");
1427  p.addPar("RSGO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSGO)
1428  .setUnit(U_VOLTM1)
1429 
1430  .setDescription("Gate-bias dependence of series resistance");
1431  p.addPar("THESATO", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATO)
1432  .setUnit(U_VOLTM1)
1433 
1434  .setDescription("Geometry independent velocity saturation parameter at TR");
1435  p.addPar("THESATL", static_cast<double>(0.05), &ADMSPSP103VA::Model::THESATL)
1436  .setUnit(U_VOLTM1)
1437 
1438  .setDescription("Length dependence of THESAT");
1439  p.addPar("THESATLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::THESATLEXP)
1440  .setDescription("Exponent for length dependence of THESAT");
1441  p.addPar("THESATW", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATW)
1442  .setDescription("Width dependence of velocity saturation parameter");
1443  p.addPar("THESATLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATLW)
1444  .setDescription("Area dependence of velocity saturation parameter");
1445  p.addPar("STTHESATO", static_cast<double>(1.0), &ADMSPSP103VA::Model::STTHESATO)
1446  .setDescription("Geometry independent temperature dependence of THESAT");
1447  p.addPar("STTHESATL", static_cast<double>(0.0), &ADMSPSP103VA::Model::STTHESATL)
1448  .setDescription("Length dependence of temperature dependence of THESAT");
1449  p.addPar("STTHESATW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STTHESATW)
1450  .setDescription("Width dependence of temperature dependence of THESAT");
1451  p.addPar("STTHESATLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::STTHESATLW)
1452  .setDescription("Area dependence of temperature dependence of THESAT");
1453  p.addPar("THESATBO", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATBO)
1454  .setUnit(U_VOLTM1)
1455 
1456  .setDescription("Back-bias dependence of velocity saturation");
1457  p.addPar("THESATGO", static_cast<double>(0.0), &ADMSPSP103VA::Model::THESATGO)
1458  .setUnit(U_VOLTM1)
1459 
1460  .setDescription("Gate-bias dependence of velocity saturation");
1461  p.addPar("AXO", static_cast<double>(18), &ADMSPSP103VA::Model::AXO)
1462  .setDescription("Geometry independent linear/saturation transition factor");
1463  p.addPar("AXL", static_cast<double>(0.4), &ADMSPSP103VA::Model::AXL)
1464  .setDescription("Length dependence of AX");
1465  p.addPar("ALPL", static_cast<double>(5e-4), &ADMSPSP103VA::Model::ALPL)
1466  .setDescription("Length dependence of ALP");
1467  p.addPar("ALPLEXP", static_cast<double>(1.0), &ADMSPSP103VA::Model::ALPLEXP)
1468  .setDescription("Exponent for length dependence of ALP");
1469  p.addPar("ALPW", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALPW)
1470  .setDescription("Width dependence of ALP");
1471  p.addPar("ALP1L1", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP1L1)
1472  .setUnit(U_VOLT)
1473 
1474  .setDescription("Length dependence of CLM enhancement factor above threshold");
1475  p.addPar("ALP1LEXP", static_cast<double>(0.5), &ADMSPSP103VA::Model::ALP1LEXP)
1476  .setDescription("Exponent for length dependence of ALP1");
1477  p.addPar("ALP1L2", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP1L2)
1478  .setDescription("Second order length dependence of ALP1");
1479  p.addPar("ALP1W", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP1W)
1480  .setDescription("Width dependence of ALP1");
1481  p.addPar("ALP2L1", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP2L1)
1482  .setUnit(U_VOLTM1)
1483 
1484  .setDescription("Length dependence of CLM enhancement factor below threshold");
1485  p.addPar("ALP2LEXP", static_cast<double>(0.5), &ADMSPSP103VA::Model::ALP2LEXP)
1486  .setDescription("Exponent for length dependence of ALP2");
1487  p.addPar("ALP2L2", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP2L2)
1488  .setDescription("Second order length dependence of ALP2");
1489  p.addPar("ALP2W", static_cast<double>(0.0), &ADMSPSP103VA::Model::ALP2W)
1490  .setDescription("Width dependence of ALP2");
1491  p.addPar("VPO", static_cast<double>(0.05), &ADMSPSP103VA::Model::VPO)
1492  .setUnit(U_VOLT)
1493 
1494  .setDescription("CLM logarithmic dependence parameter");
1495  p.addPar("A1O", static_cast<double>(1.0), &ADMSPSP103VA::Model::A1O)
1496  .setDescription("Geometry independent impact-ionization pre-factor");
1497  p.addPar("A1L", static_cast<double>(0.0), &ADMSPSP103VA::Model::A1L)
1498  .setDescription("Length dependence of A1");
1499  p.addPar("A1W", static_cast<double>(0.0), &ADMSPSP103VA::Model::A1W)
1500  .setDescription("Width dependence of A1");
1501  p.addPar("A2O", static_cast<double>(10), &ADMSPSP103VA::Model::A2O)
1502  .setUnit(U_VOLT)
1503 
1504  .setDescription("Impact-ionization exponent at TR");
1505  p.addPar("STA2O", static_cast<double>(0.0), &ADMSPSP103VA::Model::STA2O)
1506  .setUnit(U_VOLT)
1507 
1508  .setDescription("Temperature dependence of A2");
1509  p.addPar("A3O", static_cast<double>(1.0), &ADMSPSP103VA::Model::A3O)
1510  .setDescription("Geometry independent saturation-voltage dependence of II");
1511  p.addPar("A3L", static_cast<double>(0.0), &ADMSPSP103VA::Model::A3L)
1512  .setDescription("Length dependence of A3");
1513  p.addPar("A3W", static_cast<double>(0.0), &ADMSPSP103VA::Model::A3W)
1514  .setDescription("Width dependence of A3");
1515  p.addPar("A4O", static_cast<double>(0.0), &ADMSPSP103VA::Model::A4O)
1516  .setUnit(U_VOLTMH)
1517 
1518  .setDescription("Geometry independent back-bias dependence of II");
1519  p.addPar("A4L", static_cast<double>(0.0), &ADMSPSP103VA::Model::A4L)
1520  .setDescription("Length dependence of A4");
1521  p.addPar("A4W", static_cast<double>(0.0), &ADMSPSP103VA::Model::A4W)
1522  .setDescription("Width dependence of A4");
1523  p.addPar("GCOO", static_cast<double>(0.0), &ADMSPSP103VA::Model::GCOO)
1524  .setDescription("Gate tunneling energy adjustment");
1525  p.addPar("IGINVLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGINVLW)
1526  .setUnit(U_AMP)
1527 
1528  .setDescription("Gate channel current pre-factor for 1 um**2 channel area");
1529  p.addPar("IGOVW", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGOVW)
1530  .setUnit(U_AMP)
1531 
1532  .setDescription("Gate overlap current pre-factor for 1 um wide channel");
1533  p.addPar("IGOVDW", static_cast<double>(0.0), &ADMSPSP103VA::Model::IGOVDW)
1534  .setUnit(U_AMP)
1535 
1536  .setDescription("Gate overlap current pre-factor for 1 um wide channel for drain side");
1537  p.addPar("STIGO", static_cast<double>(2.0), &ADMSPSP103VA::Model::STIGO)
1538  .setDescription("Temperature dependence of IGINV and IGOV");
1539  p.addPar("GC2O", static_cast<double>(0.375), &ADMSPSP103VA::Model::GC2O)
1540  .setDescription("Gate current slope factor");
1541  p.addPar("GC3O", static_cast<double>(0.063), &ADMSPSP103VA::Model::GC3O)
1542  .setDescription("Gate current curvature factor");
1543  p.addPar("CHIBO", static_cast<double>(3.1), &ADMSPSP103VA::Model::CHIBO)
1544  .setUnit(U_VOLT)
1545 
1546  .setDescription("Tunneling barrier height");
1547  p.addPar("AGIDLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::AGIDLW)
1548  .setUnit(U_AMPVM3)
1549 
1550  .setDescription("Width dependence of GIDL pre-factor");
1551  p.addPar("AGIDLDW", static_cast<double>(0.0), &ADMSPSP103VA::Model::AGIDLDW)
1552  .setUnit(U_AMPVM3)
1553 
1554  .setDescription("Width dependence of GIDL pre-factor for drain side");
1555  p.addPar("BGIDLO", static_cast<double>(41), &ADMSPSP103VA::Model::BGIDLO)
1556  .setUnit(U_VOLT)
1557 
1558  .setDescription("GIDL probability factor at TR");
1559  p.addPar("BGIDLDO", static_cast<double>(41), &ADMSPSP103VA::Model::BGIDLDO)
1560  .setUnit(U_VOLT)
1561 
1562  .setDescription("GIDL probability factor at TR for drain side");
1563  p.addPar("STBGIDLO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBGIDLO)
1564  .setUnit(U_VKM1)
1565 
1566  .setDescription("Temperature dependence of BGIDL");
1567  p.addPar("STBGIDLDO", static_cast<double>(0.0), &ADMSPSP103VA::Model::STBGIDLDO)
1568  .setUnit(U_VKM1)
1569 
1570  .setDescription("Temperature dependence of BGIDL for drain side");
1571  p.addPar("CGIDLO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGIDLO)
1572  .setDescription("Back-bias dependence of GIDL");
1573  p.addPar("CGIDLDO", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGIDLDO)
1574  .setDescription("Back-bias dependence of GIDL for drain side");
1575  p.addPar("CGBOVL", static_cast<double>(0.0), &ADMSPSP103VA::Model::CGBOVL)
1576  .setUnit(U_FARAD)
1577 
1578  .setDescription("Oxide capacitance for gate-bulk overlap for 1 um long channel");
1579  p.addPar("CFRW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFRW)
1580  .setUnit(U_FARAD)
1581 
1582  .setDescription("Outer fringe capacitance for 1 um wide channel");
1583  p.addPar("CFRDW", static_cast<double>(0.0), &ADMSPSP103VA::Model::CFRDW)
1584  .setUnit(U_FARAD)
1585 
1586  .setDescription("Outer fringe capacitance for 1 um wide channel for drain side");
1587  p.addPar("FNTO", static_cast<double>(1.0), &ADMSPSP103VA::Model::FNTO)
1588  .setDescription("Thermal noise coefficient");
1589  p.addPar("NFALW", static_cast<double>(8e22), &ADMSPSP103VA::Model::NFALW)
1590  .setDescription("First coefficient of flicker noise for 1 um**2 channel area");
1591  p.addPar("NFBLW", static_cast<double>(3e7), &ADMSPSP103VA::Model::NFBLW)
1592  .setDescription("Second coefficient of flicker noise for 1 um**2 channel area");
1593  p.addPar("NFCLW", static_cast<double>(0.0), &ADMSPSP103VA::Model::NFCLW)
1594  .setUnit(U_VOLTM1)
1595 
1596  .setDescription("Third coefficient of flicker noise for 1 um**2 channel area");
1597  p.addPar("EFO", static_cast<double>(1.0), &ADMSPSP103VA::Model::EFO)
1598  .setDescription("Flicker noise frequency exponent");
1599  p.addPar("LINTNOI", static_cast<double>(0.0), &ADMSPSP103VA::Model::LINTNOI)
1600  .setUnit(U_METER)
1601 
1602  .setDescription("Length offset for flicker noise");
1603  p.addPar("ALPNOI", static_cast<double>(2.0), &ADMSPSP103VA::Model::ALPNOI)
1604  .setDescription("Exponent for length offset for flicker noise");
1605  p.addPar("KVTHOWEO", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHOWEO)
1606  .setDescription("Geometrical independent threshold shift parameter");
1607  p.addPar("KVTHOWEL", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHOWEL)
1608  .setDescription("Length dependent threshold shift parameter");
1609  p.addPar("KVTHOWEW", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHOWEW)
1610  .setDescription("Width dependent threshold shift parameter");
1611  p.addPar("KVTHOWELW", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHOWELW)
1612  .setDescription("Area dependent threshold shift parameter");
1613  p.addPar("KUOWEO", static_cast<double>(0), &ADMSPSP103VA::Model::KUOWEO)
1614  .setDescription("Geometrical independent mobility degradation factor");
1615  p.addPar("KUOWEL", static_cast<double>(0), &ADMSPSP103VA::Model::KUOWEL)
1616  .setDescription("Length dependent mobility degradation factor");
1617  p.addPar("KUOWEW", static_cast<double>(0), &ADMSPSP103VA::Model::KUOWEW)
1618  .setDescription("Width dependent mobility degradation factor");
1619  p.addPar("KUOWELW", static_cast<double>(0), &ADMSPSP103VA::Model::KUOWELW)
1620  .setDescription("Area dependent mobility degradation factor");
1621  p.addPar("RGO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RGO)
1622  .setUnit(U_OHM)
1623 
1624  .setDescription("Gate resistance");
1625  p.addPar("RINT", static_cast<double>(0.0), &ADMSPSP103VA::Model::RINT)
1626  .setUnit(U_OHMM2)
1627 
1628  .setDescription("Contact resistance between silicide and ploy");
1629  p.addPar("RVPOLY", static_cast<double>(0.0), &ADMSPSP103VA::Model::RVPOLY)
1630  .setUnit(U_OHMM2)
1631 
1632  .setDescription("Vertical poly resistance");
1633  p.addPar("RSHG", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSHG)
1634  .setUnit(U_OSQM1)
1635 
1636  .setDescription("Gate electrode diffusion sheet resistance");
1637  p.addPar("DLSIL", static_cast<double>(0.0), &ADMSPSP103VA::Model::DLSIL)
1638  .setUnit(U_METER)
1639 
1640  .setDescription("Silicide extension over the physical gate length");
1641  p.addPar("RSH", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSH)
1642  .setUnit(U_OSQM1)
1643 
1644  .setDescription("Sheet resistance of source diffusion");
1645  p.addPar("RSHD", static_cast<double>(0.0), &ADMSPSP103VA::Model::RSHD)
1646  .setUnit(U_OSQM1)
1647 
1648  .setDescription("Sheet resistance of drain diffusion");
1649  p.addPar("RBULKO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RBULKO)
1650  .setUnit(U_OHM)
1651 
1652  .setDescription("Bulk resistance between node BP and BI");
1653  p.addPar("RWELLO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RWELLO)
1654  .setUnit(U_OHM)
1655 
1656  .setDescription("Well resistance between node BI and B");
1657  p.addPar("RJUNSO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RJUNSO)
1658  .setUnit(U_OHM)
1659 
1660  .setDescription("Source-side bulk resistance between node BI and BS");
1661  p.addPar("RJUNDO", static_cast<double>(0.0), &ADMSPSP103VA::Model::RJUNDO)
1662  .setUnit(U_OHM)
1663 
1664  .setDescription("Drain-side bulk resistance between node BI and BD");
1665  p.addPar("SAREF", static_cast<double>(1.0e-6), &ADMSPSP103VA::Model::SAREF)
1666  .setUnit(U_METER)
1667 
1668  .setDescription("Reference distance between OD-edge and poly from one side");
1669  p.addPar("SBREF", static_cast<double>(1.0e-6), &ADMSPSP103VA::Model::SBREF)
1670  .setUnit(U_METER)
1671 
1672  .setDescription("Reference distance between OD-edge and poly from other side");
1673  p.addPar("WLOD", static_cast<double>(0), &ADMSPSP103VA::Model::WLOD)
1674  .setUnit(U_METER)
1675 
1676  .setDescription("Width parameter");
1677  p.addPar("KUO", static_cast<double>(0), &ADMSPSP103VA::Model::KUO)
1678  .setUnit(U_METER)
1679 
1680  .setDescription("Mobility degradation/enhancement coefficient");
1681  p.addPar("KVSAT", static_cast<double>(0), &ADMSPSP103VA::Model::KVSAT)
1682  .setUnit(U_METER)
1683 
1684  .setDescription("Saturation velocity degradation/enhancement coefficient");
1685  p.addPar("TKUO", static_cast<double>(0), &ADMSPSP103VA::Model::TKUO)
1686  .setDescription("Temperature dependence of KUO");
1687  p.addPar("LKUO", static_cast<double>(0), &ADMSPSP103VA::Model::LKUO)
1688  .setDescription("Length dependence of KUO");
1689  p.addPar("WKUO", static_cast<double>(0), &ADMSPSP103VA::Model::WKUO)
1690  .setDescription("Width dependence of KUO");
1691  p.addPar("PKUO", static_cast<double>(0), &ADMSPSP103VA::Model::PKUO)
1692  .setDescription("Cross-term dependence of KUO");
1693  p.addPar("LLODKUO", static_cast<double>(0), &ADMSPSP103VA::Model::LLODKUO)
1694  .setDescription("Length parameter for UO stress effect");
1695  p.addPar("WLODKUO", static_cast<double>(0), &ADMSPSP103VA::Model::WLODKUO)
1696  .setDescription("Width parameter for UO stress effect");
1697  p.addPar("KVTHO", static_cast<double>(0), &ADMSPSP103VA::Model::KVTHO)
1698  .setUnit(U_VM)
1699 
1700  .setDescription("Threshold shift parameter");
1701  p.addPar("LKVTHO", static_cast<double>(0), &ADMSPSP103VA::Model::LKVTHO)
1702  .setDescription("Length dependence of KVTHO");
1703  p.addPar("WKVTHO", static_cast<double>(0), &ADMSPSP103VA::Model::WKVTHO)
1704  .setDescription("Width dependence of KVTHO");
1705  p.addPar("PKVTHO", static_cast<double>(0), &ADMSPSP103VA::Model::PKVTHO)
1706  .setDescription("Cross-term dependence of KVTHO");
1707  p.addPar("LLODVTH", static_cast<double>(0), &ADMSPSP103VA::Model::LLODVTH)
1708  .setDescription("Length parameter for VTH-stress effect");
1709  p.addPar("WLODVTH", static_cast<double>(0), &ADMSPSP103VA::Model::WLODVTH)
1710  .setDescription("Width parameter for VTH-stress effect");
1711  p.addPar("STETAO", static_cast<double>(0), &ADMSPSP103VA::Model::STETAO)
1712  .setUnit(U_METER)
1713 
1714  .setDescription("eta0 shift factor related to VTHO change");
1715  p.addPar("LODETAO", static_cast<double>(1.0), &ADMSPSP103VA::Model::LODETAO)
1716  .setDescription("eta0 shift modification factor for stress effect");
1717  p.addPar("SCREF", static_cast<double>(1.0e-6), &ADMSPSP103VA::Model::SCREF)
1718  .setUnit(U_METER)
1719 
1720  .setDescription("Distance between OD-edge and well edge of a reference device");
1721  p.addPar("WEB", static_cast<double>(0), &ADMSPSP103VA::Model::WEB)
1722  .setDescription("Coefficient for SCB");
1723  p.addPar("WEC", static_cast<double>(0), &ADMSPSP103VA::Model::WEC)
1724  .setDescription("Coefficient for SCC");
1725  p.addPar("IMAX", static_cast<double>(1000), &ADMSPSP103VA::Model::IMAX)
1726  .setDescription("Maximum current up to which forward current behaves exponentially");
1727  p.addPar("TRJ", static_cast<double>(21), &ADMSPSP103VA::Model::TRJ)
1728  .setDescription("reference temperature");
1729  p.addPar("CJORBOT", static_cast<double>(1E-3), &ADMSPSP103VA::Model::CJORBOT)
1730  .setDescription("Zero-bias capacitance per unit-of-area of bottom component for source-bulk junction");
1731  p.addPar("CJORSTI", static_cast<double>(1E-9), &ADMSPSP103VA::Model::CJORSTI)
1732  .setDescription("Zero-bias capacitance per unit-of-length of STI-edge component for source-bulk junction");
1733  p.addPar("CJORGAT", static_cast<double>(1E-9), &ADMSPSP103VA::Model::CJORGAT)
1734  .setDescription("Zero-bias capacitance per unit-of-length of gate-edge component for source-bulk junction");
1735  p.addPar("VBIRBOT", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRBOT)
1736  .setDescription("Built-in voltage at the reference temperature of bottom component for source-bulk junction");
1737  p.addPar("VBIRSTI", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRSTI)
1738  .setDescription("Built-in voltage at the reference temperature of STI-edge component for source-bulk junction");
1739  p.addPar("VBIRGAT", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRGAT)
1740  .setDescription("Built-in voltage at the reference temperature of gate-edge component for source-bulk junction");
1741  p.addPar("PBOT", static_cast<double>(0.5), &ADMSPSP103VA::Model::PBOT)
1742  .setDescription("Grading coefficient of bottom component for source-bulk junction");
1743  p.addPar("PSTI", static_cast<double>(0.5), &ADMSPSP103VA::Model::PSTI)
1744  .setDescription("Grading coefficient of STI-edge component for source-bulk junction");
1745  p.addPar("PGAT", static_cast<double>(0.5), &ADMSPSP103VA::Model::PGAT)
1746  .setDescription("Grading coefficient of gate-edge component for source-bulk junction");
1747  p.addPar("PHIGBOT", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGBOT)
1748  .setDescription("Zero-temperature bandgap voltage of bottom component for source-bulk junction");
1749  p.addPar("PHIGSTI", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGSTI)
1750  .setDescription("Zero-temperature bandgap voltage of STI-edge component for source-bulk junction");
1751  p.addPar("PHIGGAT", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGGAT)
1752  .setDescription("Zero-temperature bandgap voltage of gate-edge component for source-bulk junction");
1753  p.addPar("IDSATRBOT", static_cast<double>(1E-12), &ADMSPSP103VA::Model::IDSATRBOT)
1754  .setDescription("Saturation current density at the reference temperature of bottom component for source-bulk junction");
1755  p.addPar("IDSATRSTI", static_cast<double>(1E-18), &ADMSPSP103VA::Model::IDSATRSTI)
1756  .setDescription("Saturation current density at the reference temperature of STI-edge component for source-bulk junction");
1757  p.addPar("IDSATRGAT", static_cast<double>(1E-18), &ADMSPSP103VA::Model::IDSATRGAT)
1758  .setDescription("Saturation current density at the reference temperature of gate-edge component for source-bulk junction");
1759  p.addPar("CSRHBOT", static_cast<double>(1E2), &ADMSPSP103VA::Model::CSRHBOT)
1760  .setDescription("Shockley-Read-Hall prefactor of bottom component for source-bulk junction");
1761  p.addPar("CSRHSTI", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CSRHSTI)
1762  .setDescription("Shockley-Read-Hall prefactor of STI-edge component for source-bulk junction");
1763  p.addPar("CSRHGAT", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CSRHGAT)
1764  .setDescription("Shockley-Read-Hall prefactor of gate-edge component for source-bulk junction");
1765  p.addPar("XJUNSTI", static_cast<double>(100E-9), &ADMSPSP103VA::Model::XJUNSTI)
1766  .setDescription("Junction depth of STI-edge component for source-bulk junction");
1767  p.addPar("XJUNGAT", static_cast<double>(100E-9), &ADMSPSP103VA::Model::XJUNGAT)
1768  .setDescription("Junction depth of gate-edge component for source-bulk junction");
1769  p.addPar("CTATBOT", static_cast<double>(1E2), &ADMSPSP103VA::Model::CTATBOT)
1770  .setDescription("Trap-assisted tunneling prefactor of bottom component for source-bulk junction");
1771  p.addPar("CTATSTI", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CTATSTI)
1772  .setDescription("Trap-assisted tunneling prefactor of STI-edge component for source-bulk junction");
1773  p.addPar("CTATGAT", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CTATGAT)
1774  .setDescription("Trap-assisted tunneling prefactor of gate-edge component for source-bulk junction");
1775  p.addPar("MEFFTATBOT", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATBOT)
1776  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of bottom component for source-bulk junction");
1777  p.addPar("MEFFTATSTI", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATSTI)
1778  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of STI-edge component for source-bulk junction");
1779  p.addPar("MEFFTATGAT", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATGAT)
1780  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of gate-edge component for source-bulk junction");
1781  p.addPar("CBBTBOT", static_cast<double>(1E-12), &ADMSPSP103VA::Model::CBBTBOT)
1782  .setDescription("Band-to-band tunneling prefactor of bottom component for source-bulk junction");
1783  p.addPar("CBBTSTI", static_cast<double>(1E-18), &ADMSPSP103VA::Model::CBBTSTI)
1784  .setDescription("Band-to-band tunneling prefactor of STI-edge component for source-bulk junction");
1785  p.addPar("CBBTGAT", static_cast<double>(1E-18), &ADMSPSP103VA::Model::CBBTGAT)
1786  .setDescription("Band-to-band tunneling prefactor of gate-edge component for source-bulk junction");
1787  p.addPar("FBBTRBOT", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRBOT)
1788  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of bottom component for source-bulk junction");
1789  p.addPar("FBBTRSTI", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRSTI)
1790  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of STI-edge component for source-bulk junction");
1791  p.addPar("FBBTRGAT", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRGAT)
1792  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of gate-edge component for source-bulk junction");
1793  p.addPar("STFBBTBOT", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTBOT)
1794  .setDescription("Temperature scaling parameter for band-to-band tunneling of bottom component for source-bulk junction");
1795  p.addPar("STFBBTSTI", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTSTI)
1796  .setDescription("Temperature scaling parameter for band-to-band tunneling of STI-edge component for source-bulk junction");
1797  p.addPar("STFBBTGAT", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTGAT)
1798  .setDescription("Temperature scaling parameter for band-to-band tunneling of gate-edge component for source-bulk junction");
1799  p.addPar("VBRBOT", static_cast<double>(10), &ADMSPSP103VA::Model::VBRBOT)
1800  .setDescription("Breakdown voltage of bottom component for source-bulk junction");
1801  p.addPar("VBRSTI", static_cast<double>(10), &ADMSPSP103VA::Model::VBRSTI)
1802  .setDescription("Breakdown voltage of STI-edge component for source-bulk junction");
1803  p.addPar("VBRGAT", static_cast<double>(10), &ADMSPSP103VA::Model::VBRGAT)
1804  .setDescription("Breakdown voltage of gate-edge component for source-bulk junction");
1805  p.addPar("PBRBOT", static_cast<double>(4), &ADMSPSP103VA::Model::PBRBOT)
1806  .setDescription("Breakdown onset tuning parameter of bottom component for source-bulk junction");
1807  p.addPar("PBRSTI", static_cast<double>(4), &ADMSPSP103VA::Model::PBRSTI)
1808  .setDescription("Breakdown onset tuning parameter of STI-edge component for source-bulk junction");
1809  p.addPar("PBRGAT", static_cast<double>(4), &ADMSPSP103VA::Model::PBRGAT)
1810  .setDescription("Breakdown onset tuning parameter of gate-edge component for source-bulk junction");
1811  p.addPar("CJORBOTD", static_cast<double>(1E-3), &ADMSPSP103VA::Model::CJORBOTD)
1812  .setDescription("Zero-bias capacitance per unit-of-area of bottom component for drain-bulk junction");
1813  p.addPar("CJORSTID", static_cast<double>(1E-9), &ADMSPSP103VA::Model::CJORSTID)
1814  .setDescription("Zero-bias capacitance per unit-of-length of STI-edge component for drain-bulk junction");
1815  p.addPar("CJORGATD", static_cast<double>(1E-9), &ADMSPSP103VA::Model::CJORGATD)
1816  .setDescription("Zero-bias capacitance per unit-of-length of gate-edge component for drain-bulk junction");
1817  p.addPar("VBIRBOTD", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRBOTD)
1818  .setDescription("Built-in voltage at the reference temperature of bottom component for drain-bulk junction");
1819  p.addPar("VBIRSTID", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRSTID)
1820  .setDescription("Built-in voltage at the reference temperature of STI-edge component for drain-bulk junction");
1821  p.addPar("VBIRGATD", static_cast<double>(1), &ADMSPSP103VA::Model::VBIRGATD)
1822  .setDescription("Built-in voltage at the reference temperature of gate-edge component for drain-bulk junction");
1823  p.addPar("PBOTD", static_cast<double>(0.5), &ADMSPSP103VA::Model::PBOTD)
1824  .setDescription("Grading coefficient of bottom component for drain-bulk junction");
1825  p.addPar("PSTID", static_cast<double>(0.5), &ADMSPSP103VA::Model::PSTID)
1826  .setDescription("Grading coefficient of STI-edge component for drain-bulk junction");
1827  p.addPar("PGATD", static_cast<double>(0.5), &ADMSPSP103VA::Model::PGATD)
1828  .setDescription("Grading coefficient of gate-edge component for drain-bulk junction");
1829  p.addPar("PHIGBOTD", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGBOTD)
1830  .setDescription("Zero-temperature bandgap voltage of bottom component for drain-bulk junction");
1831  p.addPar("PHIGSTID", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGSTID)
1832  .setDescription("Zero-temperature bandgap voltage of STI-edge component for drain-bulk junction");
1833  p.addPar("PHIGGATD", static_cast<double>(1.16), &ADMSPSP103VA::Model::PHIGGATD)
1834  .setDescription("Zero-temperature bandgap voltage of gate-edge component for drain-bulk junction");
1835  p.addPar("IDSATRBOTD", static_cast<double>(1E-12), &ADMSPSP103VA::Model::IDSATRBOTD)
1836  .setDescription("Saturation current density at the reference temperature of bottom component for drain-bulk junction");
1837  p.addPar("IDSATRSTID", static_cast<double>(1E-18), &ADMSPSP103VA::Model::IDSATRSTID)
1838  .setDescription("Saturation current density at the reference temperature of STI-edge component for drain-bulk junction");
1839  p.addPar("IDSATRGATD", static_cast<double>(1E-18), &ADMSPSP103VA::Model::IDSATRGATD)
1840  .setDescription("Saturation current density at the reference temperature of gate-edge component for drain-bulk junction");
1841  p.addPar("CSRHBOTD", static_cast<double>(1E2), &ADMSPSP103VA::Model::CSRHBOTD)
1842  .setDescription("Shockley-Read-Hall prefactor of bottom component for drain-bulk junction");
1843  p.addPar("CSRHSTID", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CSRHSTID)
1844  .setDescription("Shockley-Read-Hall prefactor of STI-edge component for drain-bulk junction");
1845  p.addPar("CSRHGATD", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CSRHGATD)
1846  .setDescription("Shockley-Read-Hall prefactor of gate-edge component for drain-bulk junction");
1847  p.addPar("XJUNSTID", static_cast<double>(100E-9), &ADMSPSP103VA::Model::XJUNSTID)
1848  .setDescription("Junction depth of STI-edge component for drain-bulk junction");
1849  p.addPar("XJUNGATD", static_cast<double>(100E-9), &ADMSPSP103VA::Model::XJUNGATD)
1850  .setDescription("Junction depth of gate-edge component for drain-bulk junction");
1851  p.addPar("CTATBOTD", static_cast<double>(1E2), &ADMSPSP103VA::Model::CTATBOTD)
1852  .setDescription("Trap-assisted tunneling prefactor of bottom component for drain-bulk junction");
1853  p.addPar("CTATSTID", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CTATSTID)
1854  .setDescription("Trap-assisted tunneling prefactor of STI-edge component for drain-bulk junction");
1855  p.addPar("CTATGATD", static_cast<double>(1E-4), &ADMSPSP103VA::Model::CTATGATD)
1856  .setDescription("Trap-assisted tunneling prefactor of gate-edge component for drain-bulk junction");
1857  p.addPar("MEFFTATBOTD", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATBOTD)
1858  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of bottom component for drain-bulk junction");
1859  p.addPar("MEFFTATSTID", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATSTID)
1860  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of STI-edge component for drain-bulk junction");
1861  p.addPar("MEFFTATGATD", static_cast<double>(0.25), &ADMSPSP103VA::Model::MEFFTATGATD)
1862  .setDescription("Effective mass (in units of m0) for trap-assisted tunneling of gate-edge component for drain-bulk junction");
1863  p.addPar("CBBTBOTD", static_cast<double>(1E-12), &ADMSPSP103VA::Model::CBBTBOTD)
1864  .setDescription("Band-to-band tunneling prefactor of bottom component for drain-bulk junction");
1865  p.addPar("CBBTSTID", static_cast<double>(1E-18), &ADMSPSP103VA::Model::CBBTSTID)
1866  .setDescription("Band-to-band tunneling prefactor of STI-edge component for drain-bulk junction");
1867  p.addPar("CBBTGATD", static_cast<double>(1E-18), &ADMSPSP103VA::Model::CBBTGATD)
1868  .setDescription("Band-to-band tunneling prefactor of gate-edge component for drain-bulk junction");
1869  p.addPar("FBBTRBOTD", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRBOTD)
1870  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of bottom component for drain-bulk junction");
1871  p.addPar("FBBTRSTID", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRSTID)
1872  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of STI-edge component for drain-bulk junction");
1873  p.addPar("FBBTRGATD", static_cast<double>(1E9), &ADMSPSP103VA::Model::FBBTRGATD)
1874  .setDescription("Normalization field at the reference temperature for band-to-band tunneling of gate-edge component for drain-bulk junction");
1875  p.addPar("STFBBTBOTD", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTBOTD)
1876  .setDescription("Temperature scaling parameter for band-to-band tunneling of bottom component for drain-bulk junction");
1877  p.addPar("STFBBTSTID", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTSTID)
1878  .setDescription("Temperature scaling parameter for band-to-band tunneling of STI-edge component for drain-bulk junction");
1879  p.addPar("STFBBTGATD", static_cast<double>((-1E-3)), &ADMSPSP103VA::Model::STFBBTGATD)
1880  .setDescription("Temperature scaling parameter for band-to-band tunneling of gate-edge component for drain-bulk junction");
1881  p.addPar("VBRBOTD", static_cast<double>(10), &ADMSPSP103VA::Model::VBRBOTD)
1882  .setDescription("Breakdown voltage of bottom component for drain-bulk junction");
1883  p.addPar("VBRSTID", static_cast<double>(10), &ADMSPSP103VA::Model::VBRSTID)
1884  .setDescription("Breakdown voltage of STI-edge component for drain-bulk junction");
1885  p.addPar("VBRGATD", static_cast<double>(10), &ADMSPSP103VA::Model::VBRGATD)
1886  .setDescription("Breakdown voltage of gate-edge component for drain-bulk junction");
1887  p.addPar("PBRBOTD", static_cast<double>(4), &ADMSPSP103VA::Model::PBRBOTD)
1888  .setDescription("Breakdown onset tuning parameter of bottom component for drain-bulk junction");
1889  p.addPar("PBRSTID", static_cast<double>(4), &ADMSPSP103VA::Model::PBRSTID)
1890  .setDescription("Breakdown onset tuning parameter of STI-edge component for drain-bulk junction");
1891  p.addPar("PBRGATD", static_cast<double>(4), &ADMSPSP103VA::Model::PBRGATD)
1892  .setDescription("Breakdown onset tuning parameter of gate-edge component for drain-bulk junction");
1893  p.addPar("SWJUNEXP", static_cast<double>(0.0), &ADMSPSP103VA::Model::SWJUNEXP)
1894  .setDescription("Flag for JUNCAP-express; 0=full model, 1=express model");
1895  p.addPar("VJUNREF", static_cast<double>(2.5), &ADMSPSP103VA::Model::VJUNREF)
1896  .setDescription("Typical maximum source-bulk junction voltage; usually about 2*VSUP");
1897  p.addPar("FJUNQ", static_cast<double>(0.03), &ADMSPSP103VA::Model::FJUNQ)
1898  .setDescription("Fraction below which source-bulk junction capacitance components are considered negligible");
1899  p.addPar("VJUNREFD", static_cast<double>(2.5), &ADMSPSP103VA::Model::VJUNREFD)
1900  .setDescription("Typical maximum drain-bulk junction voltage; usually about 2*VSUP");
1901  p.addPar("FJUNQD", static_cast<double>(0.03), &ADMSPSP103VA::Model::FJUNQD)
1902  .setDescription("Fraction below which drain-bulk junction capacitance components are considered negligible");
1903  p.addPar("DTA", static_cast<double>(0.0), &ADMSPSP103VA::Model::DTA)
1904  .setUnit(U_DEGK)
1905 
1906  .setDescription("Temperature offset w.r.t. ambient temperature");
1907 
1908 }
1909 
1910 //-----------------------------------------------------------------------------
1911 // Function : Instance::processParams
1912 // Purpose :
1913 // Special Notes :
1914 // Scope : public
1915 // Creator : admsXml
1916 // Creation Date :
1917 //-----------------------------------------------------------------------------
1919 {
1920  // Now we need to check that any parameters are within their ranges as
1921  // specified in the verilog:
1922 
1923  // Parameter L : [ 1e-9, (+inf) [
1924  if ( (!((L >=1e-9))) )
1925  {
1926  UserError0(*this) << "ADMSPSP103VA: Parameter L value " << L << " out of range [ 1e-9, (+inf) [";
1927  }
1928 
1929  // Parameter W : [ 1e-9, (+inf) [
1930  if ( (!((W >=1e-9))) )
1931  {
1932  UserError0(*this) << "ADMSPSP103VA: Parameter W value " << W << " out of range [ 1e-9, (+inf) [";
1933  }
1934 
1935  // Parameter SCA : [ 0.0, (+inf) [
1936  if ( (!((SCA >=0.0))) )
1937  {
1938  UserError0(*this) << "ADMSPSP103VA: Parameter SCA value " << SCA << " out of range [ 0.0, (+inf) [";
1939  }
1940 
1941  // Parameter SCB : [ 0.0, (+inf) [
1942  if ( (!((SCB >=0.0))) )
1943  {
1944  UserError0(*this) << "ADMSPSP103VA: Parameter SCB value " << SCB << " out of range [ 0.0, (+inf) [";
1945  }
1946 
1947  // Parameter SCC : [ 0.0, (+inf) [
1948  if ( (!((SCC >=0.0))) )
1949  {
1950  UserError0(*this) << "ADMSPSP103VA: Parameter SCC value " << SCC << " out of range [ 0.0, (+inf) [";
1951  }
1952 
1953  // Parameter NF : [ 1.0, (+inf) [
1954  if ( (!((NF >=1.0))) )
1955  {
1956  UserError0(*this) << "ADMSPSP103VA: Parameter NF value " << NF << " out of range [ 1.0, (+inf) [";
1957  }
1958 
1959  // Parameter NGCON : [ 1.0, 2.0 ]
1960  if ( (!((NGCON >=1.0 && NGCON <=2.0 ))) )
1961  {
1962  UserError0(*this) << "ADMSPSP103VA: Parameter NGCON value " << NGCON << " out of range [ 1.0, 2.0 ]";
1963  }
1964 
1965  // Parameter JW : [ 0, (+inf) [
1966  if ( (!((JW >=0))) )
1967  {
1968  UserError0(*this) << "ADMSPSP103VA: Parameter JW value " << JW << " out of range [ 0, (+inf) [";
1969  }
1970 
1971  // Parameter FACTUO : [ 0.0, (+inf) [
1972  if ( (!((FACTUO >=0.0))) )
1973  {
1974  UserError0(*this) << "ADMSPSP103VA: Parameter FACTUO value " << FACTUO << " out of range [ 0.0, (+inf) [";
1975  }
1976 
1977  // Parameter ABSOURCE : [ 0, (+inf) [
1978  if ( (!((ABSOURCE >=0))) )
1979  {
1980  UserError0(*this) << "ADMSPSP103VA: Parameter ABSOURCE value " << ABSOURCE << " out of range [ 0, (+inf) [";
1981  }
1982 
1983  // Parameter LSSOURCE : [ 0, (+inf) [
1984  if ( (!((LSSOURCE >=0))) )
1985  {
1986  UserError0(*this) << "ADMSPSP103VA: Parameter LSSOURCE value " << LSSOURCE << " out of range [ 0, (+inf) [";
1987  }
1988 
1989  // Parameter LGSOURCE : [ 0, (+inf) [
1990  if ( (!((LGSOURCE >=0))) )
1991  {
1992  UserError0(*this) << "ADMSPSP103VA: Parameter LGSOURCE value " << LGSOURCE << " out of range [ 0, (+inf) [";
1993  }
1994 
1995  // Parameter ABDRAIN : [ 0, (+inf) [
1996  if ( (!((ABDRAIN >=0))) )
1997  {
1998  UserError0(*this) << "ADMSPSP103VA: Parameter ABDRAIN value " << ABDRAIN << " out of range [ 0, (+inf) [";
1999  }
2000 
2001  // Parameter LSDRAIN : [ 0, (+inf) [
2002  if ( (!((LSDRAIN >=0))) )
2003  {
2004  UserError0(*this) << "ADMSPSP103VA: Parameter LSDRAIN value " << LSDRAIN << " out of range [ 0, (+inf) [";
2005  }
2006 
2007  // Parameter LGDRAIN : [ 0, (+inf) [
2008  if ( (!((LGDRAIN >=0))) )
2009  {
2010  UserError0(*this) << "ADMSPSP103VA: Parameter LGDRAIN value " << LGDRAIN << " out of range [ 0, (+inf) [";
2011  }
2012 
2013  // Parameter AS : [ 0, (+inf) [
2014  if ( (!((AS >=0))) )
2015  {
2016  UserError0(*this) << "ADMSPSP103VA: Parameter AS value " << AS << " out of range [ 0, (+inf) [";
2017  }
2018 
2019  // Parameter PS : [ 0, (+inf) [
2020  if ( (!((PS >=0))) )
2021  {
2022  UserError0(*this) << "ADMSPSP103VA: Parameter PS value " << PS << " out of range [ 0, (+inf) [";
2023  }
2024 
2025  // Parameter AD : [ 0, (+inf) [
2026  if ( (!((AD >=0))) )
2027  {
2028  UserError0(*this) << "ADMSPSP103VA: Parameter AD value " << AD << " out of range [ 0, (+inf) [";
2029  }
2030 
2031  // Parameter PD : [ 0, (+inf) [
2032  if ( (!((PD >=0))) )
2033  {
2034  UserError0(*this) << "ADMSPSP103VA: Parameter PD value " << PD << " out of range [ 0, (+inf) [";
2035  }
2036 
2037  // Parameter MULT : [ 0.0, (+inf) [
2038  if ( (!((MULT >=0.0))) )
2039  {
2040  UserError0(*this) << "ADMSPSP103VA: Parameter MULT value " << MULT << " out of range [ 0.0, (+inf) [";
2041  }
2042 
2043 
2044  // this seems a little stupid, but verilog models that use $temperature
2045  // don't also use a defined parameter "Temp", and count on $temperature
2046  // to be the one the simulator wants:
2047 
2049 
2050  // and of course, this routine is where we should put the initial_instance
2051  // stuff
2052  double I5;
2053  double I4;
2054  double I3;
2055  double I2;
2056  double I1;
2057  double ijungat;
2058  double ijunsti;
2059  double ijunbot;
2060  double V5;
2061  double V4;
2062  double V3;
2063  double V2;
2064  double V1;
2065  double FRACI;
2066  double FRACNB;
2067  double FRACNA;
2068  double qjungat;
2069  double qjunsti;
2070  double qjunbot;
2071  double fbreakdown;
2072  double Fmaxr;
2073  double ibbt;
2074  double gammamax;
2075  double erfctimesexpmtat;
2076  double xerfc;
2077  double mtat;
2078  double ltat;
2079  double ktat;
2080  double wtat;
2081  double wgamma;
2082  double umaxpoweronepointfive;
2083  double sqrtumax;
2084  double umax;
2085  double umaxbeforelimiting;
2086  double twoatatoverthreebtat;
2087  double btat;
2088  double itat;
2089  double asrh;
2090  double wdep;
2091  double wsrh;
2092  double dwsrh;
2093  double wsrhstep;
2094  double vbi_minus_vjsrh;
2095  double isrh;
2096  double id;
2097  double tmp;
2098  double vav;
2099  double vbbt;
2100  double vjsrh;
2101  double vjlim;
2102  double two_psistar;
2103  double zinv;
2104  double z;
2105  double vj;
2106  double idmult;
2107  double h5;
2108  double h4;
2109  double h3;
2110  double h2d;
2111  double h2;
2112  double h1;
2113  double erfcpos;
2114  double terfc;
2115  double ysq;
2116  double pmax;
2117  double vbigat2r;
2118  double vbisti2r;
2119  double vbibot2r;
2120  double pgat2;
2121  double psti2;
2122  double pbot2;
2123  double vbigat2;
2124  double vbisti2;
2125  double vbibot2;
2126  double vmaxgat;
2127  double vmaxsti;
2128  double vmaxbot;
2129  double alphaje;
2130  double zfrac;
2131  double tt2;
2132  double tt1;
2133  double tt0;
2134  double I5_cor;
2135  double I4_cor;
2136  double I3_cor;
2137  double I2_cor;
2138  double I1_cor;
2139  double mcor_rev;
2140  double m0_rev;
2141  double jww;
2142  double jwcorr;
2143  double LGD_i;
2144  double LSD_i;
2145  double ABD_i;
2146  double LGS_i;
2147  double LSS_i;
2148  double ABS_i;
2149  double NEFFAC_i;
2150  double Sfl_prefac;
2151  double Cox_over_q;
2152  double nt;
2153  double tempM;
2154  double tf_ig;
2155  double tf_thesat;
2156  double tf_ther;
2157  double tf_xcor;
2158  double tf_cs;
2159  double tf_mue;
2160  double tf_bet;
2161  double CoxovPrime_d;
2162  double CoxovPrime;
2163  double phix2;
2164  double dphibq;
2165  double qb0;
2166  double np;
2167  double arg2max;
2168  double tox_sq;
2169  double CoxPrime;
2170  double EPSOX;
2171  double DELVTO_i;
2172  double FACTUO_i;
2173  double EF_i;
2174  double NFC_i;
2175  double NFB_i;
2176  double NFA_i;
2177  double FNT_i;
2178  double STBGIDLD_i;
2179  double STBGIDL_i;
2180  double STIG_i;
2181  double GCO_i;
2182  double STA2_i;
2183  double VP_i;
2184  double STTHESAT_i;
2185  double STRS_i;
2186  double RS_i;
2187  double FETA_i;
2188  double STXCOR_i;
2189  double STCS_i;
2190  double STTHEMU_i;
2191  double STMUE_i;
2192  double STBET_i;
2193  double BETN_i;
2194  double NOVD_i;
2195  double NOV_i;
2196  double TOXOVD_i;
2197  double TOXOV_i;
2198  double CT_i;
2199  double NP_i;
2200  double DELVTAC_i;
2201  double DPHIB_i;
2202  double DVSBNUD_i;
2203  double VSBNUD_i;
2204  double FACNEFFAC_i;
2205  double NEFF_i;
2206  double EPSROX_i;
2207  double TOX_i;
2208  double STVFB_i;
2209  double temp00;
2210  double Kstressvth0;
2211  double rhobetaref;
2212  double rhobeta;
2213  double Kstressu0;
2214  double tempw;
2215  double templ;
2216  double Wx;
2217  double Lx;
2218  double Invsbref;
2219  double Invsaref;
2220  double Invsb;
2221  double Invsa;
2222  double loop;
2223  double tmpb;
2224  double tmpa;
2225  double iiiLWcv;
2226  double iLcv;
2227  double iiLWcv;
2228  double iiWcv;
2229  double iiLcv;
2230  double iiiLEWEcv;
2231  double iLEcv;
2232  double iiLEWEcv;
2233  double iiWEcv;
2234  double iiLEcv;
2235  double iiiLEWE;
2236  double iiLEWE;
2237  double iiWE;
2238  double iiLE;
2239  double iLEWE;
2240  double KUOWE;
2241  double KVTHOWE;
2242  double Lred;
2243  double Lnoi;
2244  double temp0;
2245  double tmpx;
2246  double GWE;
2247  double GPE;
2248  double LP1e;
2249  double FBET1e;
2250  double NSUB;
2251  double BB;
2252  double AA;
2253  double LPCKe;
2254  double NPCKe;
2255  double NSUB0e;
2256  double RJUND_p;
2257  double RJUNS_p;
2258  double RBULK_p;
2259  double RWELL_p;
2260  double RDE_p;
2261  double RSE_p;
2262  double RG_p;
2263  double EF_p;
2264  double NFC_p;
2265  double NFB_p;
2266  double NFA_p;
2267  double FNT_p;
2268  double CFRD_p;
2269  double CFR_p;
2270  double CGBOV_p;
2271  double CGOVD_p;
2272  double CGOV_p;
2273  double COX_p;
2274  double CGIDLD_p;
2275  double CGIDL_p;
2276  double STBGIDLD_p;
2277  double STBGIDL_p;
2278  double BGIDLD_p;
2279  double BGIDL_p;
2280  double AGIDLD_p;
2281  double AGIDL_p;
2282  double CHIB_p;
2283  double GC3_p;
2284  double GC2_p;
2285  double STIG_p;
2286  double IGOVD_p;
2287  double IGOV_p;
2288  double IGINV_p;
2289  double GCO_p;
2290  double A4_p;
2291  double A3_p;
2292  double STA2_p;
2293  double A2_p;
2294  double A1_p;
2295  double VP_p;
2296  double ALP2_p;
2297  double ALP1_p;
2298  double ALP_p;
2299  double AX_p;
2300  double THESATG_p;
2301  double THESATB_p;
2302  double STTHESAT_p;
2303  double THESAT_p;
2304  double RSG_p;
2305  double RSB_p;
2306  double STRS_p;
2307  double RS_p;
2308  double FETA_p;
2309  double STXCOR_p;
2310  double XCOR_p;
2311  double STCS_p;
2312  double CS_p;
2313  double STTHEMU_p;
2314  double THEMU_p;
2315  double STMUE_p;
2316  double MUE_p;
2317  double STBET_p;
2318  double BETN_p;
2319  double CFB_p;
2320  double CF_p;
2321  double NOVD_p;
2322  double NOV_p;
2323  double TOXOVD_p;
2324  double TOXOV_p;
2325  double CT_p;
2326  double NP_p;
2327  double DELVTAC_p;
2328  double DPHIB_p;
2329  double DNSUB_p;
2330  double NSLP_p;
2331  double VNSUB_p;
2332  double DVSBNUD_p;
2333  double VSBNUD_p;
2334  double GFACNUD_p;
2335  double FACNEFFAC_p;
2336  double NEFF_p;
2337  double EPSROX_p;
2338  double TOX_p;
2339  double STVFB_p;
2340  double VFB_p;
2341  double XGWE;
2342  double W_f;
2343  double L_slif;
2344  double L_f;
2345  double iWE;
2346  double iLE;
2347  double Wcv;
2348  double Lcv;
2349  double WEcv;
2350  double LEcv;
2351  double delWOD;
2352  double delLPS;
2353  double iW;
2354  double iL;
2355  double WEN;
2356  double LEN;
2357  double NGCON_i;
2358  double SCC_i;
2359  double SCB_i;
2360  double SCA_i;
2361  double JW_i;
2362  double PD_i;
2363  double AD_i;
2364  double PS_i;
2365  double AS_i;
2366  double XGW_i;
2367  double SC_i;
2368  double SD_i;
2369  double SB_i;
2370  double SA_i;
2371  double W_i;
2372  double L_i;
2373  double WE;
2374  double LE;
2375  double invNF;
2376  double NF_i;
2377  //Begin block initial_instance
2378  {
2379  NF_i = 1.0;
2380  invNF = 1.0;
2381  LE = 0.0;
2382  WE = 0.0;
2383  L_i = L;
2384  W_i = W;
2385  SA_i = SA;
2386  SB_i = SB;
2387  SD_i = SD;
2388  SC_i = SC;
2389  XGW_i = XGW;
2390  ABSOURCE_i = ABSOURCE;
2391  LSSOURCE_i = LSSOURCE;
2392  LGSOURCE_i = LGSOURCE;
2393  ABDRAIN_i = ABDRAIN;
2394  LSDRAIN_i = LSDRAIN;
2395  LGDRAIN_i = LGDRAIN;
2396  AS_i = AS;
2397  PS_i = PS;
2398  AD_i = AD;
2399  PD_i = PD;
2400  JW_i = JW;
2401  if ((((model_.SWGEO_i)==1)||((model_.SWGEO_i)==2)))
2402  {
2403  NF_i = ((NF>1.0)?NF:1.0);
2404  NF_i = floor((NF_i+0.5));
2405  invNF = (1.0/NF_i);
2406  L_i = ((L_i>1e-9)?L_i:1e-9);
2407  W_i = (((W_i*invNF)>1e-9)?(W_i*invNF):1e-9);
2408  SCA_i = ((SCA>0.0)?SCA:0.0);
2409  SCB_i = ((SCB>0.0)?SCB:0.0);
2410  SCC_i = ((SCC>0.0)?SCC:0.0);
2411  NGCON_i = ((NGCON<1.5)?1.0:2.0);
2412  LEN = 1e-6;
2413  WEN = 1e-6;
2414  iL = (LEN/L_i);
2415  iW = (WEN/W_i);
2416  if (((model_.SWGEO_i)==2))
2417  {
2418  delLPS = ((model_.LVARO)*(1.0+((model_.LVARL)*iL)));
2419  delWOD = ((model_.WVARO)*(1.0+((model_.WVARW)*iW)));
2420  }
2421  else
2422  {
2423  delLPS = (((model_.LVARO)*(1.0+((model_.LVARL)*iL)))*(1.0+((model_.LVARW)*iW)));
2424  delWOD = (((model_.WVARO)*(1.0+((model_.WVARL)*iL)))*(1.0+((model_.WVARW)*iW)));
2425  }
2426  LE = ((((L_i+delLPS)-(2.0*(model_.LAP)))>1e-9)?((L_i+delLPS)-(2.0*(model_.LAP))):1e-9);
2427  WE = ((((W_i+delWOD)-(2.0*(model_.WOT)))>1e-9)?((W_i+delWOD)-(2.0*(model_.WOT))):1e-9);
2428  LEcv = (((((L_i+delLPS)-(2.0*(model_.LAP)))+(model_.DLQ))>1e-9)?(((L_i+delLPS)-(2.0*(model_.LAP)))+(model_.DLQ)):1e-9);
2429  WEcv = (((((W_i+delWOD)-(2.0*(model_.WOT)))+(model_.DWQ))>1e-9)?(((W_i+delWOD)-(2.0*(model_.WOT)))+(model_.DWQ)):1e-9);
2430  Lcv = ((((L_i+delLPS)+(model_.DLQ))>1e-9)?((L_i+delLPS)+(model_.DLQ)):1e-9);
2431  Wcv = ((((W_i+delWOD)+(model_.DWQ))>1e-9)?((W_i+delWOD)+(model_.DWQ)):1e-9);
2432  iLE = (LEN/LE);
2433  iWE = (WEN/WE);
2434  L_f = (((L_i+delLPS)>1e-9)?(L_i+delLPS):1e-9);
2435  L_slif = (((L_f+(model_.DLSIL))>1e-9)?(L_f+(model_.DLSIL)):1e-9);
2436  W_f = (((W_i+delWOD)>1e-9)?(W_i+delWOD):1e-9);
2437  XGWE = (((XGW_i-(0.5*delWOD))>1e-9)?(XGW_i-(0.5*delWOD)):1e-9);
2438  }
2439  if (((model_.SWGEO_i)==0))
2440  {
2441  VFB_p = (model_.VFB);
2442  STVFB_p = (model_.STVFB);
2443  TOX_p = (model_.TOX);
2444  EPSROX_p = (model_.EPSROX);
2445  NEFF_p = (model_.NEFF);
2446  FACNEFFAC_p = (model_.FACNEFFAC);
2447  GFACNUD_p = (model_.GFACNUD);
2448  VSBNUD_p = (model_.VSBNUD);
2449  DVSBNUD_p = (model_.DVSBNUD);
2450  VNSUB_p = (model_.VNSUB);
2451  NSLP_p = (model_.NSLP);
2452  DNSUB_p = (model_.DNSUB);
2453  DPHIB_p = (model_.DPHIB);
2454  DELVTAC_p = (model_.DELVTAC);
2455  NP_p = (model_.NP);
2456  CT_p = (model_.CT);
2457  TOXOV_p = (model_.TOXOV);
2458  TOXOVD_p = (model_.TOXOVD);
2459  NOV_p = (model_.NOV);
2460  NOVD_p = (model_.NOVD);
2461  CF_p = (model_.CF);
2462  CFB_p = (model_.CFB);
2463  BETN_p = (model_.BETN);
2464  STBET_p = (model_.STBET);
2465  MUE_p = (model_.MUE);
2466  STMUE_p = (model_.STMUE);
2467  THEMU_p = (model_.THEMU);
2468  STTHEMU_p = (model_.STTHEMU);
2469  CS_p = (model_.CS);
2470  STCS_p = (model_.STCS);
2471  XCOR_p = (model_.XCOR);
2472  STXCOR_p = (model_.STXCOR);
2473  FETA_p = (model_.FETA);
2474  RS_p = (model_.RS);
2475  STRS_p = (model_.STRS);
2476  RSB_p = (model_.RSB);
2477  RSG_p = (model_.RSG);
2478  THESAT_p = (model_.THESAT);
2479  STTHESAT_p = (model_.STTHESAT);
2480  THESATB_p = (model_.THESATB);
2481  THESATG_p = (model_.THESATG);
2482  AX_p = (model_.AX);
2483  ALP_p = (model_.ALP);
2484  ALP1_p = (model_.ALP1);
2485  ALP2_p = (model_.ALP2);
2486  VP_p = (model_.VP);
2487  A1_p = (model_.A1);
2488  A2_p = (model_.A2);
2489  STA2_p = (model_.STA2);
2490  A3_p = (model_.A3);
2491  A4_p = (model_.A4);
2492  GCO_p = (model_.GCO);
2493  IGINV_p = (model_.IGINV);
2494  IGOV_p = (model_.IGOV);
2495  IGOVD_p = (model_.IGOVD);
2496  STIG_p = (model_.STIG);
2497  GC2_p = (model_.GC2);
2498  GC3_p = (model_.GC3);
2499  CHIB_p = (model_.CHIB);
2500  AGIDL_p = (model_.AGIDL);
2501  AGIDLD_p = (model_.AGIDLD);
2502  BGIDL_p = (model_.BGIDL);
2503  BGIDLD_p = (model_.BGIDLD);
2504  STBGIDL_p = (model_.STBGIDL);
2505  STBGIDLD_p = (model_.STBGIDLD);
2506  CGIDL_p = (model_.CGIDL);
2507  CGIDLD_p = (model_.CGIDLD);
2508  COX_p = (model_.COX);
2509  CGOV_p = (model_.CGOV);
2510  CGOVD_p = (model_.CGOVD);
2511  CGBOV_p = (model_.CGBOV);
2512  CFR_p = (model_.CFR);
2513  CFRD_p = (model_.CFRD);
2514  FNT_p = (model_.FNT);
2515  NFA_p = (model_.NFA);
2516  NFB_p = (model_.NFB);
2517  NFC_p = (model_.NFC);
2518  EF_p = (model_.EF);
2519  RG_p = (model_.RG);
2520  RSE_p = (model_.RSE);
2521  RDE_p = (model_.RDE);
2522  RWELL_p = (model_.RWELL);
2523  RBULK_p = (model_.RBULK);
2524  RJUNS_p = (model_.RJUNS);
2525  RJUND_p = (model_.RJUND);
2526  }
2527  if (((model_.SWGEO_i)==1))
2528  {
2529  VFB_p = ((((model_.VFBO)+((model_.VFBL)*iLE))+((model_.VFBW)*iWE))+(((model_.VFBLW)*iLE)*iWE));
2530  STVFB_p = ((((model_.STVFBO)+((model_.STVFBL)*iLE))+((model_.STVFBW)*iWE))+(((model_.STVFBLW)*iLE)*iWE));
2531  TOX_p = (model_.TOXO);
2532  EPSROX_p = (model_.EPSROXO);
2533  NSUB0e = ((model_.NSUBO_i)*(((1.0+(((model_.NSUBW)*iWE)*log((1.0+(WE/(model_.WSEG_i))))))>1.0E-03)?(1.0+(((model_.NSUBW)*iWE)*log((1.0+(WE/(model_.WSEG_i)))))):1.0E-03));
2534  NPCKe = ((model_.NPCK_i)*(((1.0+(((model_.NPCKW)*iWE)*log((1.0+(WE/(model_.WSEGP_i))))))>1.0E-03)?(1.0+(((model_.NPCKW)*iWE)*log((1.0+(WE/(model_.WSEGP_i)))))):1.0E-03));
2535  LPCKe = ((model_.LPCK_i)*(((1.0+(((model_.LPCKW)*iWE)*log((1.0+(WE/(model_.WSEGP_i))))))>1.0E-03)?(1.0+(((model_.LPCKW)*iWE)*log((1.0+(WE/(model_.WSEGP_i)))))):1.0E-03));
2536  if ((LE>(2*LPCKe)))
2537  {
2538  AA = 7.5e10;
2539  BB = (sqrt((NSUB0e+(0.5*NPCKe)))-sqrt(NSUB0e));
2540  NSUB = (sqrt(NSUB0e)+(AA*log((1+(((2*LPCKe)/LE)*(exp((BB/AA))-1))))));
2541  NSUB = (NSUB*NSUB);
2542  }
2543  else
2544  {
2545  if ((LE>=LPCKe))
2546  {
2547  NSUB = (NSUB0e+((NPCKe*LPCKe)/LE));
2548  }
2549  else
2550  {
2551  NSUB = (NSUB0e+(NPCKe*(2-(LE/LPCKe))));
2552  }
2553  }
2554  NEFF_p = (NSUB*((1-((model_.FOL1)*iLE))-(((model_.FOL2)*iLE)*iLE)));
2555  FACNEFFAC_p = ((((model_.FACNEFFACO)+((model_.FACNEFFACL)*iLE))+((model_.FACNEFFACW)*iWE))+(((model_.FACNEFFACLW)*iLE)*iWE));
2556  GFACNUD_p = ((((model_.GFACNUDO)+((model_.GFACNUDL)*pow(iLE,(model_.GFACNUDLEXP))))+((model_.GFACNUDW)*iWE))+(((model_.GFACNUDLW)*iLE)*iWE));
2557  VSBNUD_p = (model_.VSBNUDO);
2558  DVSBNUD_p = (model_.DVSBNUDO);
2559  VNSUB_p = (model_.VNSUBO);
2560  NSLP_p = (model_.NSLPO);
2561  DNSUB_p = (model_.DNSUBO);
2562  DPHIB_p = ((((model_.DPHIBO)+((model_.DPHIBL)*pow(iLE,(model_.DPHIBLEXP))))+((model_.DPHIBW)*iWE))+(((model_.DPHIBLW)*iLE)*iWE));
2563  DELVTAC_p = ((((model_.DELVTACO)+((model_.DELVTACL)*pow(iLE,(model_.DELVTACLEXP))))+((model_.DELVTACW)*iWE))+(((model_.DELVTACLW)*iLE)*iWE));
2564  NP_p = ((model_.NPO)*((1e-6>(1.0+((model_.NPL)*iLE)))?1e-6:(1.0+((model_.NPL)*iLE))));
2565  CT_p = ((((model_.CTO)+((model_.CTL)*pow(iLE,(model_.CTLEXP))))*(1.0+((model_.CTW)*iWE)))*(1.0+(((model_.CTLW)*iLE)*iWE)));
2566  TOXOV_p = (model_.TOXOVO);
2567  TOXOVD_p = (model_.TOXOVDO);
2568  NOV_p = (model_.NOVO);
2569  NOVD_p = (model_.NOVDO);
2570  CF_p = (((model_.CFL)*pow(iLE,(model_.CFLEXP)))*(1.0+((model_.CFW)*iWE)));
2571  CFB_p = (model_.CFBO);
2572  FBET1e = ((model_.FBET1)*(1.0+((model_.FBET1W)*iWE)));
2573  LP1e = ((model_.LP1_i)*(((1.0+((model_.LP1W)*iWE))>1.0E-03)?(1.0+((model_.LP1W)*iWE)):1.0E-03));
2574  GPE = ((1.0+(((FBET1e*LP1e)/LE)*(1.0-exp(((-LE)/LP1e)))))+((((model_.FBET2)*(model_.LP2_i))/LE)*(1.0-exp(((-LE)/(model_.LP2_i))))));
2575  GPE = ((GPE>1e-15)?GPE:1e-15);
2576  GWE = ((1.0+((model_.BETW1)*iWE))+(((model_.BETW2)*iWE)*log((1.0+(WE/(model_.WBET_i))))));
2577  BETN_p = ((((model_.UO)*WE)/(GPE*LE))*GWE);
2578  STBET_p = ((((model_.STBETO)+((model_.STBETL)*iLE))+((model_.STBETW)*iWE))+(((model_.STBETLW)*iLE)*iWE));
2579  MUE_p = ((model_.MUEO)*(1.0+((model_.MUEW)*iWE)));
2580  STMUE_p = (model_.STMUEO);
2581  THEMU_p = (model_.THEMUO);
2582  STTHEMU_p = (model_.STTHEMUO);
2583  CS_p = ((((model_.CSO)+((model_.CSL)*pow(iLE,(model_.CSLEXP))))*(1.0+((model_.CSW)*iWE)))*(1.0+(((model_.CSLW)*iLE)*iWE)));
2584  STCS_p = (model_.STCSO);
2585  XCOR_p = ((((model_.XCORO)*(1.0+((model_.XCORL)*iLE)))*(1.0+((model_.XCORW)*iWE)))*(1.0+(((model_.XCORLW)*iLE)*iWE)));
2586  STXCOR_p = (model_.STXCORO);
2587  FETA_p = (model_.FETAO);
2588  RS_p = (((model_.RSW1)*iWE)*(1.0+((model_.RSW2)*iWE)));
2589  STRS_p = (model_.STRSO);
2590  RSB_p = (model_.RSBO);
2591  RSG_p = (model_.RSGO);
2592  THESAT_p = ((((model_.THESATO)+((((model_.THESATL)*GWE)/GPE)*pow(iLE,(model_.THESATLEXP))))*(1.0+((model_.THESATW)*iWE)))*(1.0+(((model_.THESATLW)*iLE)*iWE)));
2593  STTHESAT_p = ((((model_.STTHESATO)+((model_.STTHESATL)*iLE))+((model_.STTHESATW)*iWE))+(((model_.STTHESATLW)*iLE)*iWE));
2594  THESATB_p = (model_.THESATBO);
2595  THESATG_p = (model_.THESATGO);
2596  AX_p = ((model_.AXO)/(1.0+((model_.AXL_i)*iLE)));
2597  ALP_p = (((model_.ALPL)*pow(iLE,(model_.ALPLEXP)))*(1.0+((model_.ALPW)*iWE)));
2598  tmpx = pow(iLE,(model_.ALP1LEXP));
2599  ALP1_p = ((((model_.ALP1L1)*tmpx)*(1.0+((model_.ALP1W)*iWE)))/(1.0+(((model_.ALP1L2_i)*iLE)*tmpx)));
2600  tmpx = pow(iLE,(model_.ALP2LEXP));
2601  ALP2_p = ((((model_.ALP2L1)*tmpx)*(1.0+((model_.ALP2W)*iWE)))/(1.0+(((model_.ALP2L2_i)*iLE)*tmpx)));
2602  VP_p = (model_.VPO);
2603  A1_p = (((model_.A1O)*(1.0+((model_.A1L)*iLE)))*(1.0+((model_.A1W)*iWE)));
2604  A2_p = (model_.A2O);
2605  STA2_p = (model_.STA2O);
2606  A3_p = (((model_.A3O)*(1.0+((model_.A3L)*iLE)))*(1.0+((model_.A3W)*iWE)));
2607  A4_p = (((model_.A4O)*(1.0+((model_.A4L)*iLE)))*(1.0+((model_.A4W)*iWE)));
2608  GCO_p = (model_.GCOO);
2609  IGINV_p = ((model_.IGINVLW)/(iWE*iLE));
2610  IGOV_p = (((model_.IGOVW)*(model_.LOV_i))/(LEN*iWE));
2611  IGOVD_p = (((model_.IGOVDW)*(model_.LOVD_i))/(LEN*iWE));
2612  STIG_p = (model_.STIGO);
2613  GC2_p = (model_.GC2O);
2614  GC3_p = (model_.GC3O);
2615  CHIB_p = (model_.CHIBO);
2616  AGIDL_p = (((model_.AGIDLW)*(model_.LOV_i))/(LEN*iWE));
2617  AGIDLD_p = (((model_.AGIDLDW)*(model_.LOVD_i))/(LEN*iWE));
2618  BGIDL_p = (model_.BGIDLO);
2619  BGIDLD_p = (model_.BGIDLDO);
2620  STBGIDL_p = (model_.STBGIDLO);
2621  STBGIDLD_p = (model_.STBGIDLDO);
2622  CGIDL_p = (model_.CGIDLO);
2623  CGIDLD_p = (model_.CGIDLDO);
2624  COX_p = ((((8.8541878176E-12*(model_.EPSROXO_i))*WEcv)*LEcv)/(model_.TOXO_i));
2625  CGOV_p = ((((8.8541878176E-12*(model_.EPSROXO_i))*WEcv)*(model_.LOV_i))/(model_.TOXOVO_i));
2626  CGOVD_p = ((((8.8541878176E-12*(model_.EPSROXO_i))*WEcv)*(model_.LOVD_i))/(model_.TOXOVDO_i));
2627  CGBOV_p = (((model_.CGBOVL)*Lcv)/LEN);
2628  CFR_p = (((model_.CFRW)*Wcv)/WEN);
2629  CFRD_p = (((model_.CFRDW)*Wcv)/WEN);
2630  temp0 = (1.0-(((2.0*(model_.LINTNOI))*iLE)/LEN));
2631  Lnoi = ((temp0>1.0e-3)?temp0:1.0e-3);
2632  Lred = (1.0/pow(Lnoi,(model_.ALPNOI)));
2633  FNT_p = (model_.FNTO);
2634  NFA_p = (((Lred*iWE)*iLE)*(model_.NFALW));
2635  NFB_p = (((Lred*iWE)*iLE)*(model_.NFBLW));
2636  NFC_p = (((Lred*iWE)*iLE)*(model_.NFCLW));
2637  EF_p = (model_.EFO);
2638  KVTHOWE = ((((model_.KVTHOWEO)+((model_.KVTHOWEL)*iLE))+((model_.KVTHOWEW)*iWE))+(((model_.KVTHOWELW)*iLE)*iWE));
2639  KUOWE = ((((model_.KUOWEO)+((model_.KUOWEL)*iLE))+((model_.KUOWEW)*iWE))+(((model_.KUOWELW)*iLE)*iWE));
2640  }
2641  if (((model_.SWGEO_i)==2))
2642  {
2643  iLEWE = (iLE*iWE);
2644  iiLE = (LE/LEN);
2645  iiWE = (WE/WEN);
2646  iiLEWE = (iiLE*iiWE);
2647  iiiLEWE = (iiWE/iiLE);
2648  iiLEcv = (LEcv/LEN);
2649  iiWEcv = (WEcv/WEN);
2650  iiLEWEcv = (iiLEcv*iiWEcv);
2651  iLEcv = (LEN/LEcv);
2652  iiiLEWEcv = (iiWEcv/iiLEcv);
2653  iiLcv = (Lcv/LEN);
2654  iiWcv = (Wcv/WEN);
2655  iiLWcv = (iiLcv*iiWcv);
2656  iLcv = (LEN/Lcv);
2657  iiiLWcv = (iiWcv/iiLcv);
2658  VFB_p = ((((model_.POVFB)+(iLE*(model_.PLVFB)))+(iWE*(model_.PWVFB)))+(iLEWE*(model_.PLWVFB)));
2659  STVFB_p = ((((model_.POSTVFB)+(iLE*(model_.PLSTVFB)))+(iWE*(model_.PWSTVFB)))+(iLEWE*(model_.PLWSTVFB)));
2660  TOX_p = (model_.POTOX);
2661  EPSROX_p = (model_.POEPSROX);
2662  NEFF_p = ((((model_.PONEFF)+(iLE*(model_.PLNEFF)))+(iWE*(model_.PWNEFF)))+(iLEWE*(model_.PLWNEFF)));
2663  FACNEFFAC_p = ((((model_.POFACNEFFAC)+(iLE*(model_.PLFACNEFFAC)))+(iWE*(model_.PWFACNEFFAC)))+(iLEWE*(model_.PLWFACNEFFAC)));
2664  GFACNUD_p = ((((model_.POGFACNUD)+((model_.PLGFACNUD)*iLE))+((model_.PWGFACNUD)*iWE))+(((model_.PLWGFACNUD)*iLE)*iWE));
2665  VSBNUD_p = (model_.POVSBNUD);
2666  DVSBNUD_p = (model_.PODVSBNUD);
2667  VNSUB_p = (model_.POVNSUB);
2668  NSLP_p = (model_.PONSLP);
2669  DNSUB_p = (model_.PODNSUB);
2670  DPHIB_p = ((((model_.PODPHIB)+(iLE*(model_.PLDPHIB)))+(iWE*(model_.PWDPHIB)))+(iLEWE*(model_.PLWDPHIB)));
2671  DELVTAC_p = ((((model_.PODELVTAC)+(iLE*(model_.PLDELVTAC)))+(iWE*(model_.PWDELVTAC)))+(iLEWE*(model_.PLWDELVTAC)));
2672  NP_p = ((((model_.PONP)+(iLE*(model_.PLNP)))+(iWE*(model_.PWNP)))+(iLEWE*(model_.PLWNP)));
2673  CT_p = ((((model_.POCT)+(iLE*(model_.PLCT)))+(iWE*(model_.PWCT)))+(iLEWE*(model_.PLWCT)));
2674  TOXOV_p = (model_.POTOXOV);
2675  TOXOVD_p = (model_.POTOXOVD);
2676  NOV_p = ((((model_.PONOV)+(iLE*(model_.PLNOV)))+(iWE*(model_.PWNOV)))+(iLEWE*(model_.PLWNOV)));
2677  NOVD_p = ((((model_.PONOVD)+(iLE*(model_.PLNOVD)))+(iWE*(model_.PWNOVD)))+(iLEWE*(model_.PLWNOVD)));
2678  CF_p = ((((model_.POCF)+(iLE*(model_.PLCF)))+(iWE*(model_.PWCF)))+(iLEWE*(model_.PLWCF)));
2679  CFB_p = (model_.POCFB);
2680  BETN_p = ((iiWE*iLE)*((((model_.POBETN)+(iLE*(model_.PLBETN)))+(iWE*(model_.PWBETN)))+(iLEWE*(model_.PLWBETN))));
2681  STBET_p = ((((model_.POSTBET)+(iLE*(model_.PLSTBET)))+(iWE*(model_.PWSTBET)))+(iLEWE*(model_.PLWSTBET)));
2682  MUE_p = ((((model_.POMUE)+(iLE*(model_.PLMUE)))+(iWE*(model_.PWMUE)))+(iLEWE*(model_.PLWMUE)));
2683  STMUE_p = (model_.POSTMUE);
2684  THEMU_p = (model_.POTHEMU);
2685  STTHEMU_p = (model_.POSTTHEMU);
2686  CS_p = ((((model_.POCS)+(iLE*(model_.PLCS)))+(iWE*(model_.PWCS)))+(iLEWE*(model_.PLWCS)));
2687  STCS_p = (model_.POSTCS);
2688  XCOR_p = ((((model_.POXCOR)+(iLE*(model_.PLXCOR)))+(iWE*(model_.PWXCOR)))+(iLEWE*(model_.PLWXCOR)));
2689  STXCOR_p = (model_.POSTXCOR);
2690  FETA_p = (model_.POFETA);
2691  RS_p = ((((model_.PORS)+(iLE*(model_.PLRS)))+(iWE*(model_.PWRS)))+(iLEWE*(model_.PLWRS)));
2692  STRS_p = (model_.POSTRS);
2693  RSB_p = (model_.PORSB);
2694  RSG_p = (model_.PORSG);
2695  THESAT_p = ((((model_.POTHESAT)+(iLE*(model_.PLTHESAT)))+(iWE*(model_.PWTHESAT)))+(iLEWE*(model_.PLWTHESAT)));
2696  STTHESAT_p = ((((model_.POSTTHESAT)+(iLE*(model_.PLSTTHESAT)))+(iWE*(model_.PWSTTHESAT)))+(iLEWE*(model_.PLWSTTHESAT)));
2697  THESATB_p = ((((model_.POTHESATB)+(iLE*(model_.PLTHESATB)))+(iWE*(model_.PWTHESATB)))+(iLEWE*(model_.PLWTHESATB)));
2698  THESATG_p = ((((model_.POTHESATG)+(iLE*(model_.PLTHESATG)))+(iWE*(model_.PWTHESATG)))+(iLEWE*(model_.PLWTHESATG)));
2699  AX_p = ((((model_.POAX)+(iLE*(model_.PLAX)))+(iWE*(model_.PWAX)))+(iLEWE*(model_.PLWAX)));
2700  ALP_p = ((((model_.POALP)+(iLE*(model_.PLALP)))+(iWE*(model_.PWALP)))+(iLEWE*(model_.PLWALP)));
2701  ALP1_p = ((((model_.POALP1)+(iLE*(model_.PLALP1)))+(iWE*(model_.PWALP1)))+(iLEWE*(model_.PLWALP1)));
2702  ALP2_p = ((((model_.POALP2)+(iLE*(model_.PLALP2)))+(iWE*(model_.PWALP2)))+(iLEWE*(model_.PLWALP2)));
2703  VP_p = (model_.POVP);
2704  A1_p = ((((model_.POA1)+(iLE*(model_.PLA1)))+(iWE*(model_.PWA1)))+(iLEWE*(model_.PLWA1)));
2705  A2_p = (model_.POA2);
2706  STA2_p = (model_.POSTA2);
2707  A3_p = ((((model_.POA3)+(iLE*(model_.PLA3)))+(iWE*(model_.PWA3)))+(iLEWE*(model_.PLWA3)));
2708  A4_p = ((((model_.POA4)+(iLE*(model_.PLA4)))+(iWE*(model_.PWA4)))+(iLEWE*(model_.PLWA4)));
2709  GCO_p = (model_.POGCO);
2710  IGINV_p = ((((model_.POIGINV)+(iiLE*(model_.PLIGINV)))+(iiWE*(model_.PWIGINV)))+(iiLEWE*(model_.PLWIGINV)));
2711  IGOV_p = ((((model_.POIGOV)+(iLE*(model_.PLIGOV)))+(iiWE*(model_.PWIGOV)))+(iiiLEWE*(model_.PLWIGOV)));
2712  IGOVD_p = ((((model_.POIGOVD)+(iLE*(model_.PLIGOVD)))+(iiWE*(model_.PWIGOVD)))+(iiiLEWE*(model_.PLWIGOVD)));
2713  STIG_p = (model_.POSTIG);
2714  GC2_p = (model_.POGC2);
2715  GC3_p = (model_.POGC3);
2716  CHIB_p = (model_.POCHIB);
2717  AGIDL_p = ((((model_.POAGIDL)+(iLE*(model_.PLAGIDL)))+(iiWE*(model_.PWAGIDL)))+(iiiLEWE*(model_.PLWAGIDL)));
2718  AGIDLD_p = ((((model_.POAGIDLD)+(iLE*(model_.PLAGIDLD)))+(iiWE*(model_.PWAGIDLD)))+(iiiLEWE*(model_.PLWAGIDLD)));
2719  BGIDL_p = (model_.POBGIDL);
2720  BGIDLD_p = (model_.POBGIDLD);
2721  STBGIDL_p = (model_.POSTBGIDL);
2722  STBGIDLD_p = (model_.POSTBGIDLD);
2723  CGIDL_p = (model_.POCGIDL);
2724  CGIDLD_p = (model_.POCGIDLD);
2725  COX_p = ((((model_.POCOX)+(iiLEcv*(model_.PLCOX)))+(iiWEcv*(model_.PWCOX)))+(iiLEWEcv*(model_.PLWCOX)));
2726  CGOV_p = ((((model_.POCGOV)+(iLEcv*(model_.PLCGOV)))+(iiWEcv*(model_.PWCGOV)))+(iiiLEWEcv*(model_.PLWCGOV)));
2727  CGOVD_p = ((((model_.POCGOVD)+(iLEcv*(model_.PLCGOVD)))+(iiWEcv*(model_.PWCGOVD)))+(iiiLEWEcv*(model_.PLWCGOVD)));
2728  CGBOV_p = ((((model_.POCGBOV)+(iiLcv*(model_.PLCGBOV)))+(iiWcv*(model_.PWCGBOV)))+(iiLWcv*(model_.PLWCGBOV)));
2729  CFR_p = ((((model_.POCFR)+(iLcv*(model_.PLCFR)))+(iiWcv*(model_.PWCFR)))+(iiiLWcv*(model_.PLWCFR)));
2730  CFRD_p = ((((model_.POCFRD)+(iLcv*(model_.PLCFRD)))+(iiWcv*(model_.PWCFRD)))+(iiiLWcv*(model_.PLWCFRD)));
2731  FNT_p = (model_.POFNT);
2732  NFA_p = ((((model_.PONFA)+(iLE*(model_.PLNFA)))+(iWE*(model_.PWNFA)))+(iLEWE*(model_.PLWNFA)));
2733  NFB_p = ((((model_.PONFB)+(iLE*(model_.PLNFB)))+(iWE*(model_.PWNFB)))+(iLEWE*(model_.PLWNFB)));
2734  NFC_p = ((((model_.PONFC)+(iLE*(model_.PLNFC)))+(iWE*(model_.PWNFC)))+(iLEWE*(model_.PLWNFC)));
2735  EF_p = (model_.POEF);
2736  KVTHOWE = ((((model_.POKVTHOWE)+(iLE*(model_.PLKVTHOWE)))+(iWE*(model_.PWKVTHOWE)))+(iLEWE*(model_.PLWKVTHOWE)));
2737  KUOWE = ((((model_.POKUOWE)+(iLE*(model_.PLKUOWE)))+(iWE*(model_.PWKUOWE)))+(iLEWE*(model_.PLWKUOWE)));
2738  }
2739  if ((((model_.SWGEO_i)==1)||((model_.SWGEO_i)==2)))
2740  {
2741  RG_p = (((((model_.RSHG_i)*(((3.3333333333333333e-01*W_f)/NGCON_i)+XGWE))/(NGCON_i*L_slif))+(((model_.RINT_i)+(model_.RVPOLY_i))/(W_f*L_f)))+(NF_i*(model_.RGO)));
2742  if (((model_.SWJUNASYM)==0))
2743  {
2744  (model_.RSHD_i) = (model_.RSH_i);
2745  }
2746  RSE_p = (NRS*(model_.RSH_i));
2747  RDE_p = (NRD*(model_.RSHD_i));
2748  RWELL_p = (NF_i*(model_.RWELLO));
2749  RBULK_p = (NF_i*(model_.RBULKO));
2750  RJUNS_p = (NF_i*(model_.RJUNSO));
2751  RJUND_p = (NF_i*(model_.RJUNDO));
2752  tmpa = 0.0;
2753  tmpb = 0.0;
2754  loop = 0.0;
2755  if ((((SA_i>0.0)&&(SB_i>0.0))&&((NF_i==1.0)||((NF_i>1.0)&&(SD_i>0.0)))))
2756  {
2757  while ((loop<(NF_i-0.5)))
2758  {
2759  tmpa = (tmpa+(1.0/((SA_i+(0.5*L_i))+(loop*(SD_i+L_i)))));
2760  tmpb = (tmpb+(1.0/((SB_i+(0.5*L_i))+(loop*(SD_i+L_i)))));
2761  loop = (loop+1.0);
2762  }
2763  Invsa = (tmpa*invNF);
2764  Invsb = (tmpb*invNF);
2765  Invsaref = (1.0/((model_.SAREF_i)+(0.5*L_i)));
2766  Invsbref = (1.0/((model_.SBREF_i)+(0.5*L_i)));
2767  Lx = (((L_i+delLPS)>1e-9)?(L_i+delLPS):1e-9);
2768  Wx = ((((W_i+delWOD)+(model_.WLOD))>1e-9)?((W_i+delWOD)+(model_.WLOD)):1e-9);
2769  templ = (1.0/pow(Lx,(model_.LLODKUO_i)));
2770  tempw = (1.0/pow(Wx,(model_.WLODKUO_i)));
2771  Kstressu0 = ((((1.0+((model_.LKUO)*templ))+((model_.WKUO)*tempw))+(((model_.PKUO)*templ)*tempw))*(1.0+((model_.TKUO)*((model_.rT)-1.0))));
2772  rhobeta = (((model_.KUO)*(Invsa+Invsb))/Kstressu0);
2773  rhobetaref = (((model_.KUO)*(Invsaref+Invsbref))/Kstressu0);
2774  templ = (1.0/pow(Lx,(model_.LLODVTH_i)));
2775  tempw = (1.0/pow(Wx,(model_.WLODVTH_i)));
2776  Kstressvth0 = (((1.0+((model_.LKVTHO)*templ))+((model_.WKVTHO)*tempw))+(((model_.PKVTHO)*templ)*tempw));
2777  temp0 = (((Invsa+Invsb)-Invsaref)-Invsbref);
2778  BETN_p = ((BETN_p*(1.0+rhobeta))/(1.0+rhobetaref));
2779  THESAT_p = (((THESAT_p*(1.0+rhobeta))*(1.0+((model_.KVSAT_i)*rhobetaref)))/((1.0+rhobetaref)*(1.0+((model_.KVSAT_i)*rhobeta))));
2780  VFB_p = (VFB_p+(((model_.KVTHO)*temp0)/Kstressvth0));
2781  CF_p = (CF_p+(((model_.STETAO)*temp0)/pow(Kstressvth0,(model_.LODETAO_i))));
2782  }
2783  if (((((SCA_i>0.0)||(SCB_i>0.0))||(SCC_i>0.0))||(SC_i>0.0)))
2784  {
2785  if ((((SCA_i==0.0)&&(SCB_i==0.0))&&(SCC_i==0.0)))
2786  {
2787  temp0 = (SC_i+W_i);
2788  temp00 = (1.0/(model_.SCREF_i));
2789  SCA_i = (((model_.SCREF_i)*(model_.SCREF_i))/(SC_i*temp0));
2790  SCB_i = (((((0.1*SC_i)+(0.01*(model_.SCREF_i)))*exp((((-10.0)*SC_i)*temp00)))-(((0.1*temp0)+(0.01*(model_.SCREF_i)))*exp((((-10.0)*temp0)*temp00))))/W_i);
2791  SCC_i = (((((0.05*SC_i)+(0.0025*(model_.SCREF_i)))*exp((((-20.0)*SC_i)*temp00)))-(((0.05*temp0)+(0.0025*(model_.SCREF_i)))*exp((((-20.0)*temp0)*temp00))))/W_i);
2792  }
2793  temp0 = ((SCA_i+((model_.WEB_i)*SCB_i))+((model_.WEC_i)*SCC_i));
2794  VFB_p = (VFB_p+(KVTHOWE*temp0));
2795  BETN_p = (BETN_p*(1.0+(KUOWE*temp0)));
2796  }
2797  }
2798  VFB_i = VFB_p;
2799  STVFB_i = STVFB_p;
2800  TOX_i = ((TOX_p>1e-10)?TOX_p:1e-10);
2801  EPSROX_i = ((EPSROX_p>1.0)?EPSROX_p:1.0);
2802  NEFF_i = ((NEFF_p>1e20)?((NEFF_p<1e26)?NEFF_p:1e26):1e20);
2803  FACNEFFAC_i = ((FACNEFFAC_p>0.0)?FACNEFFAC_p:0.0);
2804  GFACNUD_i = ((GFACNUD_p>0.01)?GFACNUD_p:0.01);
2805  VSBNUD_i = ((VSBNUD_p>0.0)?VSBNUD_p:0.0);
2806  DVSBNUD_i = ((DVSBNUD_p>0.1)?DVSBNUD_p:0.1);
2807  VNSUB_i = VNSUB_p;
2808  NSLP_i = ((NSLP_p>1e-3)?NSLP_p:1e-3);
2809  DNSUB_i = ((DNSUB_p>0.0)?((DNSUB_p<1.0)?DNSUB_p:1.0):0.0);
2810  DPHIB_i = DPHIB_p;
2811  DELVTAC_i = DELVTAC_p;
2812  NP_i = ((NP_p>0.0)?NP_p:0.0);
2813  CT_i = ((CT_p>0.0)?CT_p:0.0);
2814  TOXOV_i = ((TOXOV_p>1e-10)?TOXOV_p:1e-10);
2815  TOXOVD_i = ((TOXOVD_p>1e-10)?TOXOVD_p:1e-10);
2816  NOV_i = ((NOV_p>1e20)?((NOV_p<1e27)?NOV_p:1e27):1e20);
2817  NOVD_i = ((NOVD_p>1e20)?((NOVD_p<1e27)?NOVD_p:1e27):1e20);
2818  CF_i = ((CF_p>0.0)?CF_p:0.0);
2819  CFB_i = ((CFB_p>0.0)?((CFB_p<1.0)?CFB_p:1.0):0.0);
2820  BETN_i = ((BETN_p>0.0)?BETN_p:0.0);
2821  STBET_i = STBET_p;
2822  MUE_i = ((MUE_p>0.0)?MUE_p:0.0);
2823  STMUE_i = STMUE_p;
2824  THEMU_i = ((THEMU_p>0.0)?THEMU_p:0.0);
2825  STTHEMU_i = STTHEMU_p;
2826  CS_i = ((CS_p>0.0)?CS_p:0.0);
2827  STCS_i = STCS_p;
2828  XCOR_i = ((XCOR_p>0.0)?XCOR_p:0.0);
2829  STXCOR_i = STXCOR_p;
2830  FETA_i = ((FETA_p>0.0)?FETA_p:0.0);
2831  RS_i = ((RS_p>0.0)?RS_p:0.0);
2832  STRS_i = STRS_p;
2833  RSB_i = ((RSB_p>(-0.5))?((RSB_p<1.0)?RSB_p:1.0):(-0.5));
2834  RSG_i = ((RSG_p>(-0.5))?RSG_p:(-0.5));
2835  THESAT_i = ((THESAT_p>0.0)?THESAT_p:0.0);
2836  STTHESAT_i = STTHESAT_p;
2837  THESATB_i = ((THESATB_p>(-0.5))?((THESATB_p<1.0)?THESATB_p:1.0):(-0.5));
2838  THESATG_i = ((THESATG_p>(-0.5))?THESATG_p:(-0.5));
2839  AX_i = ((AX_p>2.0)?AX_p:2.0);
2840  ALP_i = ((ALP_p>0.0)?ALP_p:0.0);
2841  ALP1_i = ((ALP1_p>0.0)?ALP1_p:0.0);
2842  ALP2_i = ((ALP2_p>0.0)?ALP2_p:0.0);
2843  VP_i = ((VP_p>1.0e-10)?VP_p:1.0e-10);
2844  A1_i = ((A1_p>0.0)?A1_p:0.0);
2845  A2_i = ((A2_p>0.0)?A2_p:0.0);
2846  STA2_i = STA2_p;
2847  A3_i = ((A3_p>0.0)?A3_p:0.0);
2848  A4_i = ((A4_p>0.0)?A4_p:0.0);
2849  GCO_i = ((GCO_p>(-10.0))?((GCO_p<10.0)?GCO_p:10.0):(-10.0));
2850  IGINV_i = ((IGINV_p>0.0)?IGINV_p:0.0);
2851  IGOV_i = ((IGOV_p>0.0)?IGOV_p:0.0);
2852  IGOVD_i = ((IGOVD_p>0.0)?IGOVD_p:0.0);
2853  STIG_i = STIG_p;
2854  GC2_i = ((GC2_p>0.0)?((GC2_p<10.0)?GC2_p:10.0):0.0);
2855  GC3_i = ((GC3_p>(-10.0))?((GC3_p<10.0)?GC3_p:10.0):(-10.0));
2856  CHIB_i = ((CHIB_p>1.0)?CHIB_p:1.0);
2857  AGIDL_i = ((AGIDL_p>0.0)?AGIDL_p:0.0);
2858  AGIDLD_i = ((AGIDLD_p>0.0)?AGIDLD_p:0.0);
2859  BGIDL_i = ((BGIDL_p>0.0)?BGIDL_p:0.0);
2860  BGIDLD_i = ((BGIDLD_p>0.0)?BGIDLD_p:0.0);
2861  STBGIDL_i = STBGIDL_p;
2862  STBGIDLD_i = STBGIDLD_p;
2863  CGIDL_i = CGIDL_p;
2864  CGIDLD_i = CGIDLD_p;
2865  COX_i = ((COX_p>0.0)?COX_p:0.0);
2866  CGOV_i = ((CGOV_p>0.0)?CGOV_p:0.0);
2867  CGOVD_i = ((CGOVD_p>0.0)?CGOVD_p:0.0);
2868  CGBOV_i = ((CGBOV_p>0.0)?CGBOV_p:0.0);
2869  CFR_i = ((CFR_p>0.0)?CFR_p:0.0);
2870  CFRD_i = ((CFRD_p>0.0)?CFRD_p:0.0);
2871  FNT_i = ((FNT_p>0.0)?FNT_p:0.0);
2872  NFA_i = ((NFA_p>0.0)?NFA_p:0.0);
2873  NFB_i = ((NFB_p>0.0)?NFB_p:0.0);
2874  NFC_i = ((NFC_p>0.0)?NFC_p:0.0);
2875  EF_i = ((EF_p>0.0)?EF_p:0.0);
2876  RG_i = ((RG_p>0.0)?RG_p:0.0);
2877  RSE_i = ((RSE_p>0.0)?RSE_p:0.0);
2878  RDE_i = ((RDE_p>0.0)?RDE_p:0.0);
2879  RBULK_i = ((RBULK_p>0.0)?RBULK_p:0.0);
2880  RJUNS_i = ((RJUNS_p>0.0)?RJUNS_p:0.0);
2881  RJUND_i = ((RJUND_p>0.0)?RJUND_p:0.0);
2882  RWELL_i = ((RWELL_p>0.0)?RWELL_p:0.0);
2883  MULT_i = (((MULT*NF_i)>0.0)?(MULT*NF_i):0.0);
2884  FACTUO_i = ((FACTUO>0.0)?FACTUO:0.0);
2885  DELVTO_i = DELVTO;
2886  if (((model_.SWJUNASYM_i)==0))
2887  {
2888  TOXOVD_i = TOXOV_i;
2889  NOVD_i = NOV_i;
2890  AGIDLD_i = AGIDL_i;
2891  BGIDLD_i = BGIDL_i;
2892  STBGIDLD_i = STBGIDL_i;
2893  CGIDLD_i = CGIDL_i;
2894  IGOVD_i = IGOV_i;
2895  CGOVD_i = CGOV_i;
2896  CFRD_i = CFR_i;
2897  }
2898  EPSOX = (8.8541878176E-12*EPSROX_i);
2899  phit1 = ((model_.phit)*(1.0+(CT_i*(model_.rTn))));
2900  inv_phit1 = (1.0/phit1);
2901  VFB_i = ((VFB_i+(STVFB_i*(model_.dT)))+DELVTO_i);
2902  phib_dc = (((model_.Eg)+DPHIB_i)+((2.0*(model_.phit))*log(((NEFF_i*pow((model_.phibFac),(-0.75)))*4.0e-26))));
2903  phib_dc = ((phib_dc>5.0E-2)?phib_dc:5.0E-2);
2904  CoxPrime = (EPSOX/TOX_i);
2905  tox_sq = (TOX_i*TOX_i);
2906  G_0_dc = (sqrt(((((2.0*1.6021918E-19)*NEFF_i)*(model_.EPSSI))*(model_.inv_phit)))/CoxPrime);
2907  kp = 0.0;
2908  if ((NP_i>0.0))
2909  {
2910  arg2max = (8.0e7/tox_sq);
2911  np = ((NP_i>arg2max)?NP_i:arg2max);
2912  np = ((5.0e24>np)?5.0e24:np);
2913  kp = ((((2.0*CoxPrime)*CoxPrime)*(model_.phit))/((1.6021918E-19*np)*(model_.EPSSI)));
2914  }
2915  qlim2 = ((100.0*(model_.phit))*(model_.phit));
2916  qq = 0.0;
2917  if (((model_.QMC_i)>0.0))
2918  {
2919  qq = (((0.4*5.951993)*(model_.QMC_i))*pow(CoxPrime,6.6666666666666667e-01));
2920  if (((model_.CHNL_TYPE)==(-1)))
2921  {
2922  qq = ((7.448711/5.951993)*qq);
2923  }
2924  qb0 = sqrt(((((model_.phit)*G_0_dc)*G_0_dc)*phib_dc));
2925  dphibq = ((0.75*qq)*pow(qb0,6.6666666666666667e-01));
2926  phib_dc = (phib_dc+dphibq);
2927  G_0_dc = (G_0_dc*(1.0+(((2.0*6.6666666666666667e-01)*dphibq)/qb0)));
2928  }
2929  sqrt_phib_dc = sqrt(phib_dc);
2930  phix_dc = (0.95*phib_dc);
2931  aphi_dc = ((0.0025*phib_dc)*phib_dc);
2932  bphi_dc = aphi_dc;
2933  phix2 = (0.5*sqrt(bphi_dc));
2934  phix1_dc = (0.5*(((phix_dc-phix2))-sqrt(((((phix_dc-phix2))*((phix_dc-phix2)))+aphi_dc))));
2935  us1 = (sqrt((VSBNUD_i+phib_dc))-sqrt_phib_dc);
2936  us21 = ((sqrt(((VSBNUD_i+DVSBNUD_i)+phib_dc))-sqrt_phib_dc)-us1);
2937  CoxovPrime = (EPSOX/TOXOV_i);
2938  CoxovPrime_d = (EPSOX/TOXOVD_i);
2939  GOV_s = (sqrt(((((2.0*1.6021918E-19)*NOV_i)*(model_.EPSSI))*(model_.inv_phit)))/CoxovPrime);
2940  GOV_d = (sqrt(((((2.0*1.6021918E-19)*NOVD_i)*(model_.EPSSI))*(model_.inv_phit)))/CoxovPrime_d);
2941  GOV2_s = (GOV_s*GOV_s);
2942  GOV2_d = (GOV_d*GOV_d);
2943  xi_ov_s = (1.0+(GOV_s*7.0710678118654746e-01));
2944  xi_ov_d = (1.0+(GOV_d*7.0710678118654746e-01));
2945  inv_xi_ov_s = (1.0/xi_ov_s);
2946  inv_xi_ov_d = (1.0/xi_ov_d);
2947  x_mrg_ov_s = (1.0e-5*xi_ov_s);
2948  x_mrg_ov_d = (1.0e-5*xi_ov_d);
2949  tf_bet = pow((model_.rTn),STBET_i);
2950  BETN_i = (BETN_i*tf_bet);
2951  BET_i = ((FACTUO_i*BETN_i)*CoxPrime);
2952  THEMU_i = (THEMU_i*pow((model_.rTn),STTHEMU_i));
2953  tf_mue = pow((model_.rTn),STMUE_i);
2954  MUE_i = (MUE_i*tf_mue);
2955  tf_cs = pow((model_.rTn),STCS_i);
2956  CS_i = (CS_i*tf_cs);
2957  tf_xcor = pow((model_.rTn),STXCOR_i);
2958  XCOR_i = (XCOR_i*tf_xcor);
2959  E_eff0 = ((1.0e-8*CoxPrime)/(model_.EPSSI));
2960  eta_mu = (0.5*FETA_i);
2961  eta_mu1 = 0.5;
2962  if (((model_.CHNL_TYPE)==(-1)))
2963  {
2964  eta_mu = (3.3333333333333333e-01*FETA_i);
2965  eta_mu1 = 3.3333333333333333e-01;
2966  }
2967  tf_ther = pow((model_.rTn),STRS_i);
2968  RS_i = (RS_i*tf_ther);
2969  THER_i = ((2*BET_i)*RS_i);
2970  tf_thesat = pow((model_.rTn),STTHESAT_i);
2971  THESAT_i = (THESAT_i*tf_thesat);
2972  Vdsat_lim = (3.912023005*phit1);
2973  inv_AX = (1.0/AX_i);
2974  inv_VP = (1.0/VP_i);
2975  A2_i = (A2_i*pow((model_.rT),STA2_i));
2976  tf_ig = pow((model_.rT),STIG_i);
2977  IGINV_i = (IGINV_i*tf_ig);
2978  IGOV_i = (IGOV_i*tf_ig);
2979  IGOVD_i = (IGOVD_i*tf_ig);
2980  inv_CHIB = (1.0/CHIB_i);
2981  tempM = (((4.0*3.3333333333333333e-01)*sqrt((((2*1.6021918E-19)*9.1093826E-31)*CHIB_i)))/1.05457168E-34);
2982  BCH = (tempM*TOX_i);
2983  BOV = (tempM*TOXOV_i);
2984  BOV_d = (tempM*TOXOVD_i);
2985  GCQ = 0;
2986  if ((GC3_i<0))
2987  {
2988  GCQ = (((-0.495)*GC2_i)/GC3_i);
2989  }
2990  alpha_b = (0.5*(phib_dc+(model_.Eg)));
2991  Dch = (GCO_i*phit1);
2992  Dov = (GCO_i*(model_.phit));
2993  AGIDL_i = ((AGIDL_i*4e-18)/(TOXOV_i*TOXOV_i));
2994  AGIDLD_i = ((AGIDLD_i*4e-18)/(TOXOVD_i*TOXOVD_i));
2995  tempM = (((1.0+(STBGIDL_i*(model_.dT)))>0)?(1.0+(STBGIDL_i*(model_.dT))):0);
2996  BGIDL_i = (((BGIDL_i*tempM)*TOXOV_i)*5e8);
2997  tempM = (((1.0+(STBGIDLD_i*(model_.dT)))>0)?(1.0+(STBGIDLD_i*(model_.dT))):0);
2998  BGIDLD_i = (((BGIDLD_i*tempM)*TOXOVD_i)*5e8);
2999  nt = (((FNT_i*4)*1.3806505E-23)*(model_.TKD));
3000  Cox_over_q = (CoxPrime/1.6021918E-19);
3001  Sfl_prefac = ((((model_.phit)*(model_.phit))*BET_i)/Cox_over_q);
3002  x1 = 1.25;
3003  inv_xg1_s = (1.0/(x1+(GOV_s*7.324648775608221e-1)));
3004  inv_xg1_d = (1.0/(x1+(GOV_d*7.324648775608221e-1)));
3005  NEFFAC_i = (FACNEFFAC_i*NEFF_i);
3006  NEFFAC_i = ((NEFFAC_i>1e20)?((NEFFAC_i<1e26)?NEFFAC_i:1e26):1e20);
3007  phib_ac = ((((model_.Eg)+DPHIB_i)+DELVTAC_i)+((2.0*(model_.phit))*log(((NEFFAC_i*pow((model_.phibFac),(-0.75)))*4.0e-26))));
3008  phib_ac = ((phib_ac>5.0E-2)?phib_ac:5.0E-2);
3009  G_0_ac = (sqrt(((((2.0*1.6021918E-19)*NEFFAC_i)*(model_.EPSSI))*(model_.inv_phit)))/CoxPrime);
3010  if (((model_.QMC_i)>0.0))
3011  {
3012  qb0 = sqrt(((((model_.phit)*G_0_ac)*G_0_ac)*phib_ac));
3013  dphibq = ((0.75*qq)*pow(qb0,6.6666666666666667e-01));
3014  phib_ac = (phib_ac+dphibq);
3015  G_0_ac = (G_0_ac*(1.0+(((2.0*6.6666666666666667e-01)*dphibq)/qb0)));
3016  }
3017  sqrt_phib_ac = sqrt(phib_ac);
3018  phix_ac = (0.95*phib_ac);
3019  aphi_ac = ((0.0025*phib_ac)*phib_ac);
3020  bphi_ac = aphi_ac;
3021  phix2 = (0.5*sqrt(bphi_ac));
3022  phix1_ac = (0.5*(((phix_ac-phix2))-sqrt(((((phix_ac-phix2))*((phix_ac-phix2)))+aphi_ac))));
3023  if ((RG_i>0.0))
3024  {
3025  ggate = (1.0/RG_i);
3026  }
3027  else
3028  {
3029  ggate = 0.0;
3030  }
3031  if ((RSE_i>0.0))
3032  {
3033  gsource = (1.0/RSE_i);
3034  }
3035  else
3036  {
3037  gsource = 0.0;
3038  }
3039  if ((RDE_i>0.0))
3040  {
3041  gdrain = (1.0/RDE_i);
3042  }
3043  else
3044  {
3045  gdrain = 0.0;
3046  }
3047  if ((RBULK_i>0.0))
3048  {
3049  gbulk = (1.0/RBULK_i);
3050  }
3051  else
3052  {
3053  gbulk = 0.0;
3054  }
3055  if ((RJUNS_i>0.0))
3056  {
3057  gjuns = (1.0/RJUNS_i);
3058  }
3059  else
3060  {
3061  gjuns = 0.0;
3062  }
3063  if ((RJUND_i>0.0))
3064  {
3065  gjund = (1.0/RJUND_i);
3066  }
3067  else
3068  {
3069  gjund = 0.0;
3070  }
3071  if ((RWELL_i>0.0))
3072  {
3073  gwell = (1.0/RWELL_i);
3074  }
3075  else
3076  {
3077  gwell = 0.0;
3078  }
3079  ABS_i = 0.0;
3080  LSS_i = 0.0;
3081  LGS_i = 0.0;
3082  ABD_i = 0.0;
3083  LSD_i = 0.0;
3084  LGD_i = 0.0;
3085  jwcorr = 0.0;
3086  jww = WE;
3087  if (((model_.SWGEO_i)==0))
3088  {
3089  jww = ((JW_i>0)?JW_i:0);
3090  }
3091  if (((model_.SWJUNCAP_i)==3))
3092  {
3093  jwcorr = 1.0;
3094  }
3095  ABS_i = (ABSOURCE_i*invNF);
3096  LSS_i = (LSSOURCE_i*invNF);
3097  LGS_i = (LGSOURCE_i*invNF);
3098  ABD_i = (ABDRAIN_i*invNF);
3099  LSD_i = (LSDRAIN_i*invNF);
3100  LGD_i = (LGDRAIN_i*invNF);
3101  if ((((model_.SWJUNCAP_i)==2)||((model_.SWJUNCAP_i)==3)))
3102  {
3103  ABS_i = (AS_i*invNF);
3104  LSS_i = ((PS_i*invNF)-(jwcorr*jww));
3105  LGS_i = jww;
3106  ABD_i = (AD_i*invNF);
3107  LSD_i = ((PD_i*invNF)-(jwcorr*jww));
3108  LGD_i = jww;
3109  }
3110  if (((((model_.SWJUNCAP_i)==1)||((model_.SWJUNCAP_i)==2))||((model_.SWJUNCAP_i)==3)))
3111  {
3112  ABSOURCE_i = ((ABS_i>0)?ABS_i:0);
3113  LSSOURCE_i = ((LSS_i>0)?LSS_i:0);
3114  LGSOURCE_i = ((LGS_i>0)?LGS_i:0);
3115  ABDRAIN_i = ((ABD_i>0)?ABD_i:0);
3116  LSDRAIN_i = ((LSD_i>0)?LSD_i:0);
3117  LGDRAIN_i = ((LGD_i>0)?LGD_i:0);
3118  }
3119  else
3120  {
3121  ABSOURCE_i = 0.0;
3122  LSSOURCE_i = 0.0;
3123  LGSOURCE_i = 0.0;
3124  ABDRAIN_i = 0.0;
3125  LSDRAIN_i = 0.0;
3126  LGDRAIN_i = 0.0;
3127  }
3128  vbimin_s = 0.0;
3129  vbimin_d = 0.0;
3130  vfmin_s = 0.0;
3131  vfmin_d = 0.0;
3132  vch_s = 0.0;
3133  vch_d = 0.0;
3134  vbbtlim_s = 0.0;
3135  vbbtlim_d = 0.0;
3136  VMAX_s = 0.0;
3137  VMAX_d = 0.0;
3138  exp_VMAX_over_phitd_s = 0.0;
3139  exp_VMAX_over_phitd_d = 0.0;
3140  vj = 0.0;
3141  idmult = 0.0;
3142  vjsrh = 0.0;
3143  zinv = 0.0;
3144  wdep = 0.0;
3145  wsrh = 0.0;
3146  asrh = 0.0;
3147  vav = 0.0;
3148  vbi_minus_vjsrh = 0.0;
3149  ISATFOR1_s = 0.0;
3150  ISATFOR1_d = 0.0;
3151  MFOR1_s = 1.0;
3152  MFOR1_d = 1.0;
3153  ISATFOR2_s = 0.0;
3154  ISATFOR2_d = 0.0;
3155  MFOR2_s = 1.0;
3156  MFOR2_d = 1.0;
3157  ISATREV_s = 0.0;
3158  ISATREV_d = 0.0;
3159  MREV_s = 1.0;
3160  MREV_d = 1.0;
3161  m0flag_s = 0.0;
3162  m0flag_d = 0.0;
3163  xhighf1_s = 0.0;
3164  xhighf1_d = 0.0;
3165  expxhf1_s = 0.0;
3166  expxhf1_d = 0.0;
3167  xhighf2_s = 0.0;
3168  xhighf2_d = 0.0;
3169  expxhf2_s = 0.0;
3170  expxhf2_d = 0.0;
3171  xhighr_s = 0.0;
3172  xhighr_d = 0.0;
3173  expxhr_s = 0.0;
3174  expxhr_d = 0.0;
3175  zflagbot_s = 1.0;
3176  zflagbot_d = 1.0;
3177  zflagsti_s = 1.0;
3178  zflagsti_d = 1.0;
3179  zflaggat_s = 1.0;
3180  zflaggat_d = 1.0;
3181  m0_rev = 0.0;
3182  mcor_rev = 0.0;
3183  I1_cor = 0.0;
3184  I2_cor = 0.0;
3185  I3_cor = 0.0;
3186  I4_cor = 0.0;
3187  I5_cor = 0.0;
3188  tt0 = 0.0;
3189  tt1 = 0.0;
3190  tt2 = 0.0;
3191  zfrac = 0.0;
3192  alphaje = 0.0;
3193  tmpv = 0.0;
3194  vjv = 0.0;
3195  ijun_s = 0.0;
3196  ijunbot_s = 0.0;
3197  ijunsti_s = 0.0;
3198  ijungat_s = 0.0;
3199  qjun_s = 0.0;
3200  qjunbot_s = 0.0;
3201  qjunsti_s = 0.0;
3202  qjungat_s = 0.0;
3203  ijun_d = 0.0;
3204  ijunbot_d = 0.0;
3205  ijunsti_d = 0.0;
3206  ijungat_d = 0.0;
3207  qjun_d = 0.0;
3208  qjunbot_d = 0.0;
3209  qjunsti_d = 0.0;
3210  qjungat_d = 0.0;
3211  if (((model_.SWJUNCAP_i)>0))
3212  {
3219  (model_.PBOT_i) = (model_.PBOTS_i);
3220  (model_.PSTI_i) = (model_.PSTIS_i);
3221  (model_.PGAT_i) = (model_.PGATS_i);
3255  (model_.FJUNQ_i) = (model_.FJUNQS_i);
3262  (model_.ftdbot) = (model_.ftdbot_s);
3263  (model_.ftdsti) = (model_.ftdsti_s);
3264  (model_.ftdgat) = (model_.ftdgat_s);
3268  (model_.ubibot) = (model_.ubibot_s);
3269  (model_.ubisti) = (model_.ubisti_s);
3270  (model_.ubigat) = (model_.ubigat_s);
3271  (model_.vbibot) = (model_.vbibot_s);
3272  (model_.vbisti) = (model_.vbisti_s);
3273  (model_.vbigat) = (model_.vbigat_s);
3283  (model_.cjobot) = (model_.cjobot_s);
3284  (model_.cjosti) = (model_.cjosti_s);
3285  (model_.cjogat) = (model_.cjogat_s);
3325  if ((((model_.idsatbot)*ABSOURCE_i)>0))
3326  {
3327  vmaxbot = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatbot)*ABSOURCE_i))+1)));
3328  }
3329  else
3330  {
3331  vmaxbot = 1E8;
3332  }
3333  if ((((model_.idsatsti)*LSSOURCE_i)>0))
3334  {
3335  vmaxsti = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatsti)*LSSOURCE_i))+1)));
3336  }
3337  else
3338  {
3339  vmaxsti = 1E8;
3340  }
3341  if ((((model_.idsatgat)*LGSOURCE_i)>0))
3342  {
3343  vmaxgat = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatgat)*LGSOURCE_i))+1)));
3344  }
3345  else
3346  {
3347  vmaxgat = 1E8;
3348  }
3349  VMAX_s = std::min(std::min(vmaxbot,vmaxsti),vmaxgat);
3350  if ((fabs((VMAX_s*(model_.phitdinv)))<2.3025850929940458e+02))
3351  {
3353  }
3354  else
3355  {
3356  if (((VMAX_s*(model_.phitdinv))<(-2.3025850929940458e+02)))
3357  {
3358  exp_VMAX_over_phitd_s = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(VMAX_s*(model_.phitdinv)))*(1.0+(0.5*(((-2.3025850929940458e+02)-(VMAX_s*(model_.phitdinv)))*(1.0+(((-2.3025850929940458e+02)-(VMAX_s*(model_.phitdinv)))*3.3333333333333333e-01))))))));
3359  }
3360  else
3361  {
3362  exp_VMAX_over_phitd_s = (1.0e100*(1.0+(((VMAX_s*(model_.phitdinv))-2.3025850929940458e+02)*(1.0+(0.5*(((VMAX_s*(model_.phitdinv))-2.3025850929940458e+02)*(1.0+(((VMAX_s*(model_.phitdinv))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
3363  }
3364  }
3365  vbibot2 = (model_.vbibot);
3366  vbisti2 = (model_.vbisti);
3367  vbigat2 = (model_.vbigat);
3368  pbot2 = (model_.PBOT_i);
3369  psti2 = (model_.PSTI_i);
3370  pgat2 = (model_.PGAT_i);
3371  vbibot2r = (model_.VBIRBOT_i);
3372  vbisti2r = (model_.VBIRSTI_i);
3373  vbigat2r = (model_.VBIRGAT_i);
3374  if ((ABSOURCE_i==0))
3375  {
3376  vbibot2 = ((model_.vbisti)+(model_.vbigat));
3377  pbot2 = (0.9*std::min((model_.PSTI_i),(model_.PGAT_i)));
3378  vbibot2r = ((model_.VBIRSTI_i)+(model_.VBIRGAT_i));
3379  }
3380  if ((LSSOURCE_i==0))
3381  {
3382  vbisti2 = ((model_.vbibot)+(model_.vbigat));
3383  psti2 = (0.9*std::min((model_.PBOT_i),(model_.PGAT_i)));
3384  vbisti2r = ((model_.VBIRBOT_i)+(model_.VBIRGAT_i));
3385  }
3386  if ((LGSOURCE_i==0))
3387  {
3388  vbigat2 = ((model_.vbibot)+(model_.vbisti));
3389  pgat2 = (0.9*std::min((model_.PBOT_i),(model_.PSTI_i)));
3390  vbigat2r = ((model_.VBIRBOT_i)+(model_.VBIRSTI_i));
3391  }
3392  vbimin_s = std::min(std::min(vbibot2,vbisti2),vbigat2);
3393  vch_s = (vbimin_s*0.1);
3394  pmax = std::max(std::max(pbot2,psti2),pgat2);
3395  vfmin_s = (vbimin_s*(1-pow(2,((-1.0)/pmax))));
3396  vbbtlim_s = (std::min(std::min(vbibot2r,vbisti2r),vbigat2r)-0.050);
3403  (model_.PBOT_i) = (model_.PBOTD_i);
3404  (model_.PSTI_i) = (model_.PSTID_i);
3405  (model_.PGAT_i) = (model_.PGATD_i);
3439  (model_.FJUNQ_i) = (model_.FJUNQD_i);
3446  (model_.ftdbot) = (model_.ftdbot_d);
3447  (model_.ftdsti) = (model_.ftdsti_d);
3448  (model_.ftdgat) = (model_.ftdgat_d);
3452  (model_.ubibot) = (model_.ubibot_d);
3453  (model_.ubisti) = (model_.ubisti_d);
3454  (model_.ubigat) = (model_.ubigat_d);
3455  (model_.vbibot) = (model_.vbibot_d);
3456  (model_.vbisti) = (model_.vbisti_d);
3457  (model_.vbigat) = (model_.vbigat_d);
3467  (model_.cjobot) = (model_.cjobot_d);
3468  (model_.cjosti) = (model_.cjosti_d);
3469  (model_.cjogat) = (model_.cjogat_d);
3509  if ((((model_.idsatbot)*ABDRAIN_i)>0))
3510  {
3511  vmaxbot = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatbot)*ABDRAIN_i))+1)));
3512  }
3513  else
3514  {
3515  vmaxbot = 1E8;
3516  }
3517  if ((((model_.idsatsti)*LSDRAIN_i)>0))
3518  {
3519  vmaxsti = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatsti)*LSDRAIN_i))+1)));
3520  }
3521  else
3522  {
3523  vmaxsti = 1E8;
3524  }
3525  if ((((model_.idsatgat)*LGDRAIN_i)>0))
3526  {
3527  vmaxgat = ((model_.phitd)*log((((model_.IMAX_i)/((model_.idsatgat)*LGDRAIN_i))+1)));
3528  }
3529  else
3530  {
3531  vmaxgat = 1E8;
3532  }
3533  VMAX_d = std::min(std::min(vmaxbot,vmaxsti),vmaxgat);
3534  if ((fabs((VMAX_d*(model_.phitdinv)))<2.3025850929940458e+02))
3535  {
3537  }
3538  else
3539  {
3540  if (((VMAX_d*(model_.phitdinv))<(-2.3025850929940458e+02)))
3541  {
3542  exp_VMAX_over_phitd_d = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(VMAX_d*(model_.phitdinv)))*(1.0+(0.5*(((-2.3025850929940458e+02)-(VMAX_d*(model_.phitdinv)))*(1.0+(((-2.3025850929940458e+02)-(VMAX_d*(model_.phitdinv)))*3.3333333333333333e-01))))))));
3543  }
3544  else
3545  {
3546  exp_VMAX_over_phitd_d = (1.0e100*(1.0+(((VMAX_d*(model_.phitdinv))-2.3025850929940458e+02)*(1.0+(0.5*(((VMAX_d*(model_.phitdinv))-2.3025850929940458e+02)*(1.0+(((VMAX_d*(model_.phitdinv))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
3547  }
3548  }
3549  vbibot2 = (model_.vbibot);
3550  vbisti2 = (model_.vbisti);
3551  vbigat2 = (model_.vbigat);
3552  pbot2 = (model_.PBOT_i);
3553  psti2 = (model_.PSTI_i);
3554  pgat2 = (model_.PGAT_i);
3555  vbibot2r = (model_.VBIRBOT_i);
3556  vbisti2r = (model_.VBIRSTI_i);
3557  vbigat2r = (model_.VBIRGAT_i);
3558  if ((ABDRAIN_i==0))
3559  {
3560  vbibot2 = ((model_.vbisti)+(model_.vbigat));
3561  pbot2 = (0.9*std::min((model_.PSTI_i),(model_.PGAT_i)));
3562  vbibot2r = ((model_.VBIRSTI_i)+(model_.VBIRGAT_i));
3563  }
3564  if ((LSDRAIN_i==0))
3565  {
3566  vbisti2 = ((model_.vbibot)+(model_.vbigat));
3567  psti2 = (0.9*std::min((model_.PBOT_i),(model_.PGAT_i)));
3568  vbisti2r = ((model_.VBIRBOT_i)+(model_.VBIRGAT_i));
3569  }
3570  if ((LGDRAIN_i==0))
3571  {
3572  vbigat2 = ((model_.vbibot)+(model_.vbisti));
3573  pgat2 = (0.9*std::min((model_.PBOT_i),(model_.PSTI_i)));
3574  vbigat2r = ((model_.VBIRBOT_i)+(model_.VBIRSTI_i));
3575  }
3576  vbimin_d = std::min(std::min(vbibot2,vbisti2),vbigat2);
3577  vch_d = (vbimin_d*0.1);
3578  pmax = std::max(std::max(pbot2,psti2),pgat2);
3579  vfmin_d = (vbimin_d*(1-pow(2,((-1.0)/pmax))));
3580  vbbtlim_d = (std::min(std::min(vbibot2r,vbisti2r),vbigat2r)-0.050);
3581  if (((model_.SWJUNEXP_i)==1))
3582  //Begin block JUNCAPexpressInit
3583  {
3584  //Block-local variables for block JUNCAPexpressInit
3585  double ysq;
3586  double terfc;
3587  double erfcpos;
3588  //End of Block-local variables
3589  //Block-local variables for block JUNCAPexpressInit
3590  double h1;
3591  double h2;
3592  double h2d;
3593  double h3;
3594  double h4;
3595  double h5;
3596  //End of Block-local variables
3597  //Block-local variables for block JUNCAPexpressInit
3598  double idmult;
3599  double vj;
3600  double z;
3601  double zinv;
3602  double two_psistar;
3603  double vjlim;
3604  double vjsrh;
3605  double vbbt;
3606  double vav;
3607  //End of Block-local variables
3608  //Block-local variables for block JUNCAPexpressInit
3609  double tmp;
3610  double id;
3611  //End of Block-local variables
3612  //Block-local variables for block JUNCAPexpressInit
3613  double isrh;
3614  double vbi_minus_vjsrh;
3615  double wsrhstep;
3616  double dwsrh;
3617  double wsrh;
3618  double wdep;
3619  double asrh;
3620  //End of Block-local variables
3621  //Block-local variables for block JUNCAPexpressInit
3622  double itat;
3623  double btat;
3624  double twoatatoverthreebtat;
3625  double umaxbeforelimiting;
3626  double umax;
3627  double sqrtumax;
3628  double umaxpoweronepointfive;
3629  //End of Block-local variables
3630  //Block-local variables for block JUNCAPexpressInit
3631  double wgamma;
3632  double wtat;
3633  double ktat;
3634  double ltat;
3635  double mtat;
3636  double xerfc;
3637  double erfctimesexpmtat;
3638  double gammamax;
3639  //End of Block-local variables
3640  //Block-local variables for block JUNCAPexpressInit
3641  double ibbt;
3642  double Fmaxr;
3643  //End of Block-local variables
3644  //Block-local variables for block JUNCAPexpressInit
3645  double fbreakdown;
3646  //End of Block-local variables
3647  //Block-local variables for block JUNCAPexpressInit
3648  double ijunbot;
3649  double ijunsti;
3650  double ijungat;
3651  double qjunbot;
3652  double qjunsti;
3653  double qjungat;
3654  //End of Block-local variables
3655  ysq = 0.0;
3656  terfc = 0.0;
3657  erfcpos = 0.0;
3658  h1 = 0.0;
3659  h2 = 0.0;
3660  h2d = 0.0;
3661  h3 = 0.0;
3662  h4 = 0.0;
3663  h5 = 0.0;
3664  idmult = 0.0;
3665  vj = 0.0;
3666  z = 0.0;
3667  zinv = 0.0;
3668  two_psistar = 0.0;
3669  vjlim = 0.0;
3670  vjsrh = 0.0;
3671  vbbt = 0.0;
3672  vav = 0.0;
3673  tmp = 0.0;
3674  id = 0.0;
3675  isrh = 0.0;
3676  vbi_minus_vjsrh = 0.0;
3677  wsrhstep = 0.0;
3678  dwsrh = 0.0;
3679  wsrh = 0.0;
3680  wdep = 0.0;
3681  asrh = 0.0;
3682  itat = 0.0;
3683  btat = 0.0;
3684  twoatatoverthreebtat = 0.0;
3685  umaxbeforelimiting = 0.0;
3686  umax = 0.0;
3687  sqrtumax = 0.0;
3688  umaxpoweronepointfive = 0.0;
3689  wgamma = 0.0;
3690  wtat = 0.0;
3691  ktat = 0.0;
3692  ltat = 0.0;
3693  mtat = 0.0;
3694  xerfc = 0.0;
3695  erfctimesexpmtat = 0.0;
3696  gammamax = 0.0;
3697  ibbt = 0.0;
3698  Fmaxr = 0.0;
3699  fbreakdown = 0.0;
3700  qjunbot = 0.0;
3701  qjunsti = 0.0;
3702  qjungat = 0.0;
3709  (model_.PBOT_i) = (model_.PBOTS_i);
3710  (model_.PSTI_i) = (model_.PSTIS_i);
3711  (model_.PGAT_i) = (model_.PGATS_i);
3745  (model_.FJUNQ_i) = (model_.FJUNQS_i);
3752  (model_.ftdbot) = (model_.ftdbot_s);
3753  (model_.ftdsti) = (model_.ftdsti_s);
3754  (model_.ftdgat) = (model_.ftdgat_s);
3758  (model_.ubibot) = (model_.ubibot_s);
3759  (model_.ubisti) = (model_.ubisti_s);
3760  (model_.ubigat) = (model_.ubigat_s);
3761  (model_.vbibot) = (model_.vbibot_s);
3762  (model_.vbisti) = (model_.vbisti_s);
3763  (model_.vbigat) = (model_.vbigat_s);
3773  (model_.cjobot) = (model_.cjobot_s);
3774  (model_.cjosti) = (model_.cjosti_s);
3775  (model_.cjogat) = (model_.cjogat_s);
3815  FRACNA = 0.4;
3816  FRACNB = 0.65;
3817  FRACI = 0.8;
3818  V1 = ((-FRACNA)*(model_.VJUNREF_i));
3819  V2 = ((-FRACNB)*(model_.VJUNREF_i));
3820  V3 = ((-FRACI)*(model_.VJUNREF_i));
3821  V4 = 0.1;
3822  V5 = 0.2;
3823  vbbt = 0.0;
3824  two_psistar = 0.0;
3825  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
3826  {
3827  h1 = ((4.0*vch_s)*vch_s);
3828  h2 = (vch_s/vfmin_s);
3829  h2d = (V1+(vch_s*h2));
3830  h3 = (vfmin_s+h2d);
3831  h4 = (vfmin_s-h2d);
3832  h5 = sqrt(((h4*h4)+h1));
3833  vj = (2.0*((V1*vfmin_s)/(h3+h5)));
3834  if ((V1<VMAX_s))
3835  {
3836  if ((fabs((0.5*(V1*(model_.phitdinv))))<2.3025850929940458e+02))
3837  {
3838  zinv = exp((0.5*(V1*(model_.phitdinv))));
3839  }
3840  else
3841  {
3842  if (((0.5*(V1*(model_.phitdinv)))<(-2.3025850929940458e+02)))
3843  {
3844  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*3.3333333333333333e-01))))))));
3845  }
3846  else
3847  {
3848  zinv = (1.0e100*(1.0+(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
3849  }
3850  }
3851  idmult = (zinv*zinv);
3852  }
3853  else
3854  {
3855  idmult = ((1+((V1-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
3856  zinv = sqrt(idmult);
3857  }
3858  idmult = (idmult-1.0);
3859  z = (1/zinv);
3860  if ((V1>0))
3861  {
3862  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
3863  }
3864  else
3865  {
3866  two_psistar = ((-V1)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
3867  }
3868  vjlim = (vbimin_s-two_psistar);
3869  vjsrh = (0.5*((V1+vjlim)-sqrt((((V1-vjlim)*(V1-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
3870  vbbt = (0.5*((V1+vbbtlim_s)-sqrt((((V1-vbbtlim_s)*(V1-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
3871  vav = (0.5*((V1)-sqrt((((V1)*(V1))+((4*1E-6)*1E-6)))));
3872  }
3873  if ((ABSOURCE_i==0))
3874  {
3875  ijunbot = 0;
3876  qjunbot = 0;
3877  }
3878  else
3879  {
3880  if (((model_.one_minus_PBOT)==0.5))
3881  {
3882  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
3883  }
3884  else
3885  {
3886  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
3887  }
3888  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V1-vj)));
3889  id = ((model_.idsatbot)*idmult);
3890  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
3891  {
3892  isrh = 0;
3893  }
3894  else
3895  {
3896  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
3897  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
3898  if (((model_.PBOT_i)==0.5))
3899  {
3900  dwsrh = 0;
3901  }
3902  else
3903  {
3904  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
3905  }
3906  wsrh = (wsrhstep+dwsrh);
3907  if (((model_.PBOT_i)==0.5))
3908  {
3909  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
3910  }
3911  else
3912  {
3913  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
3914  }
3915  wdep = ((model_.wdepnulrbot)*tmp);
3916  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
3917  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
3918  }
3919  if (((model_.CTATBOT_i)==0))
3920  {
3921  itat = 0;
3922  }
3923  else
3924  {
3925  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
3926  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
3927  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
3928  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
3929  sqrtumax = sqrt(fabs(umax));
3930  umaxpoweronepointfive = (umax*sqrtumax);
3931  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
3932  {
3933  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
3934  }
3935  else
3936  {
3937  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
3938  }
3939  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
3940  ktat = sqrt((0.375*(btat/sqrtumax)));
3941  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
3942  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
3943  xerfc = ((ltat-1)*ktat);
3944  ysq = (xerfc*xerfc);
3945  if ((xerfc>0))
3946  {
3947  terfc = (1/(1+((model_.perfc)*xerfc)));
3948  }
3949  else
3950  {
3951  terfc = (1/(1-((model_.perfc)*xerfc)));
3952  }
3953  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
3954  {
3955  tmp = exp(((-ysq)+mtat));
3956  }
3957  else
3958  {
3959  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
3960  }
3961  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
3962  if ((xerfc>0))
3963  {
3964  erfctimesexpmtat = erfcpos;
3965  }
3966  else
3967  {
3968  if ((mtat>(-2.3025850929940458e+02)))
3969  {
3970  tmp = exp(mtat);
3971  }
3972  else
3973  {
3974  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
3975  }
3976  erfctimesexpmtat = ((2*tmp)-erfcpos);
3977  }
3978  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
3979  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
3980  }
3981  if (((model_.CBBTBOT_i)==0))
3982  {
3983  ibbt = 0;
3984  }
3985  else
3986  {
3987  if (((model_.PBOT_i)==0.5))
3988  {
3989  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
3990  }
3991  else
3992  {
3993  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
3994  }
3995  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
3996  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
3997  {
3998  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
3999  }
4000  else
4001  {
4002  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
4003  {
4004  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
4005  }
4006  else
4007  {
4008  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4009  }
4010  }
4011  ibbt = ((model_.CBBTBOT_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
4012  }
4013  if (((model_.VBRBOT_i)>1000))
4014  {
4015  fbreakdown = 1;
4016  }
4017  else
4018  {
4019  if ((vav>((-0.999)*(model_.VBRBOT_i))))
4020  {
4021  if (((model_.PBRBOT_i)==4))
4022  {
4023  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
4024  }
4025  else
4026  {
4027  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
4028  }
4029  fbreakdown = (1/(1-tmp));
4030  }
4031  else
4032  {
4033  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
4034  }
4035  }
4036  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4037  }
4038  if ((LSSOURCE_i==0))
4039  {
4040  ijunsti = 0;
4041  qjunsti = 0;
4042  }
4043  else
4044  {
4045  if (((model_.one_minus_PSTI)==0.5))
4046  {
4047  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
4048  }
4049  else
4050  {
4051  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
4052  }
4053  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V1-vj)));
4054  id = ((model_.idsatsti)*idmult);
4055  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
4056  {
4057  isrh = 0;
4058  }
4059  else
4060  {
4061  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
4062  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4063  if (((model_.PSTI_i)==0.5))
4064  {
4065  dwsrh = 0;
4066  }
4067  else
4068  {
4069  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
4070  }
4071  wsrh = (wsrhstep+dwsrh);
4072  if (((model_.PSTI_i)==0.5))
4073  {
4074  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
4075  }
4076  else
4077  {
4078  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
4079  }
4080  wdep = ((model_.wdepnulrsti)*tmp);
4081  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
4082  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
4083  }
4084  if (((model_.CTATSTI_i)==0))
4085  {
4086  itat = 0;
4087  }
4088  else
4089  {
4090  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
4091  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
4092  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4093  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4094  sqrtumax = sqrt(fabs(umax));
4095  umaxpoweronepointfive = (umax*sqrtumax);
4096  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
4097  {
4098  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4099  }
4100  else
4101  {
4102  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
4103  }
4104  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4105  ktat = sqrt((0.375*(btat/sqrtumax)));
4106  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4107  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4108  xerfc = ((ltat-1)*ktat);
4109  ysq = (xerfc*xerfc);
4110  if ((xerfc>0))
4111  {
4112  terfc = (1/(1+((model_.perfc)*xerfc)));
4113  }
4114  else
4115  {
4116  terfc = (1/(1-((model_.perfc)*xerfc)));
4117  }
4118  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4119  {
4120  tmp = exp(((-ysq)+mtat));
4121  }
4122  else
4123  {
4124  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4125  }
4126  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4127  if ((xerfc>0))
4128  {
4129  erfctimesexpmtat = erfcpos;
4130  }
4131  else
4132  {
4133  if ((mtat>(-2.3025850929940458e+02)))
4134  {
4135  tmp = exp(mtat);
4136  }
4137  else
4138  {
4139  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4140  }
4141  erfctimesexpmtat = ((2*tmp)-erfcpos);
4142  }
4143  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
4144  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
4145  }
4146  if (((model_.CBBTSTI_i)==0))
4147  {
4148  ibbt = 0;
4149  }
4150  else
4151  {
4152  if (((model_.PSTI_i)==0.5))
4153  {
4154  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
4155  }
4156  else
4157  {
4158  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
4159  }
4160  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
4161  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
4162  {
4163  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
4164  }
4165  else
4166  {
4167  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
4168  {
4169  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
4170  }
4171  else
4172  {
4173  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4174  }
4175  }
4176  ibbt = ((model_.CBBTSTI_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
4177  }
4178  if (((model_.VBRSTI_i)>1000))
4179  {
4180  fbreakdown = 1;
4181  }
4182  else
4183  {
4184  if ((vav>((-0.999)*(model_.VBRSTI_i))))
4185  {
4186  if (((model_.PBRSTI_i)==4))
4187  {
4188  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
4189  }
4190  else
4191  {
4192  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
4193  }
4194  fbreakdown = (1/(1-tmp));
4195  }
4196  else
4197  {
4198  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
4199  }
4200  }
4201  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4202  }
4203  if ((LGSOURCE_i==0))
4204  {
4205  ijungat = 0;
4206  qjungat = 0;
4207  }
4208  else
4209  {
4210  if (((model_.one_minus_PGAT)==0.5))
4211  {
4212  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
4213  }
4214  else
4215  {
4216  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
4217  }
4218  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V1-vj)));
4219  id = ((model_.idsatgat)*idmult);
4220  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
4221  {
4222  isrh = 0;
4223  }
4224  else
4225  {
4226  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
4227  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4228  if (((model_.PGAT_i)==0.5))
4229  {
4230  dwsrh = 0;
4231  }
4232  else
4233  {
4234  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
4235  }
4236  wsrh = (wsrhstep+dwsrh);
4237  if (((model_.PGAT_i)==0.5))
4238  {
4239  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
4240  }
4241  else
4242  {
4243  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
4244  }
4245  wdep = ((model_.wdepnulrgat)*tmp);
4246  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
4247  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
4248  }
4249  if (((model_.CTATGAT_i)==0))
4250  {
4251  itat = 0;
4252  }
4253  else
4254  {
4255  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
4256  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
4257  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4258  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4259  sqrtumax = sqrt(fabs(umax));
4260  umaxpoweronepointfive = (umax*sqrtumax);
4261  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
4262  {
4263  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4264  }
4265  else
4266  {
4267  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
4268  }
4269  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4270  ktat = sqrt((0.375*(btat/sqrtumax)));
4271  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4272  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4273  xerfc = ((ltat-1)*ktat);
4274  ysq = (xerfc*xerfc);
4275  if ((xerfc>0))
4276  {
4277  terfc = (1/(1+((model_.perfc)*xerfc)));
4278  }
4279  else
4280  {
4281  terfc = (1/(1-((model_.perfc)*xerfc)));
4282  }
4283  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4284  {
4285  tmp = exp(((-ysq)+mtat));
4286  }
4287  else
4288  {
4289  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4290  }
4291  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4292  if ((xerfc>0))
4293  {
4294  erfctimesexpmtat = erfcpos;
4295  }
4296  else
4297  {
4298  if ((mtat>(-2.3025850929940458e+02)))
4299  {
4300  tmp = exp(mtat);
4301  }
4302  else
4303  {
4304  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4305  }
4306  erfctimesexpmtat = ((2*tmp)-erfcpos);
4307  }
4308  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
4309  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
4310  }
4311  if (((model_.CBBTGAT_i)==0))
4312  {
4313  ibbt = 0;
4314  }
4315  else
4316  {
4317  if (((model_.PGAT_i)==0.5))
4318  {
4319  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
4320  }
4321  else
4322  {
4323  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
4324  }
4325  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
4326  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
4327  {
4328  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
4329  }
4330  else
4331  {
4332  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
4333  {
4334  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
4335  }
4336  else
4337  {
4338  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4339  }
4340  }
4341  ibbt = ((model_.CBBTGAT_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
4342  }
4343  if (((model_.VBRGAT_i)>1000))
4344  {
4345  fbreakdown = 1;
4346  }
4347  else
4348  {
4349  if ((vav>((-0.999)*(model_.VBRGAT_i))))
4350  {
4351  if (((model_.PBRGAT_i)==4))
4352  {
4353  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
4354  }
4355  else
4356  {
4357  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
4358  }
4359  fbreakdown = (1/(1-tmp));
4360  }
4361  else
4362  {
4363  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
4364  }
4365  }
4366  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4367  }
4368  I1 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
4369  vbbt = 0.0;
4370  two_psistar = 0.0;
4371  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
4372  {
4373  h1 = ((4.0*vch_s)*vch_s);
4374  h2 = (vch_s/vfmin_s);
4375  h2d = (V2+(vch_s*h2));
4376  h3 = (vfmin_s+h2d);
4377  h4 = (vfmin_s-h2d);
4378  h5 = sqrt(((h4*h4)+h1));
4379  vj = (2.0*((V2*vfmin_s)/(h3+h5)));
4380  if ((V2<VMAX_s))
4381  {
4382  if ((fabs((0.5*(V2*(model_.phitdinv))))<2.3025850929940458e+02))
4383  {
4384  zinv = exp((0.5*(V2*(model_.phitdinv))));
4385  }
4386  else
4387  {
4388  if (((0.5*(V2*(model_.phitdinv)))<(-2.3025850929940458e+02)))
4389  {
4390  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*3.3333333333333333e-01))))))));
4391  }
4392  else
4393  {
4394  zinv = (1.0e100*(1.0+(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4395  }
4396  }
4397  idmult = (zinv*zinv);
4398  }
4399  else
4400  {
4401  idmult = ((1+((V2-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
4402  zinv = sqrt(idmult);
4403  }
4404  idmult = (idmult-1.0);
4405  z = (1/zinv);
4406  if ((V2>0))
4407  {
4408  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
4409  }
4410  else
4411  {
4412  two_psistar = ((-V2)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
4413  }
4414  vjlim = (vbimin_s-two_psistar);
4415  vjsrh = (0.5*((V2+vjlim)-sqrt((((V2-vjlim)*(V2-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
4416  vbbt = (0.5*((V2+vbbtlim_s)-sqrt((((V2-vbbtlim_s)*(V2-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
4417  vav = (0.5*((V2)-sqrt((((V2)*(V2))+((4*1E-6)*1E-6)))));
4418  }
4419  if ((ABSOURCE_i==0))
4420  {
4421  ijunbot = 0;
4422  qjunbot = 0;
4423  }
4424  else
4425  {
4426  if (((model_.one_minus_PBOT)==0.5))
4427  {
4428  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
4429  }
4430  else
4431  {
4432  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
4433  }
4434  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V2-vj)));
4435  id = ((model_.idsatbot)*idmult);
4436  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
4437  {
4438  isrh = 0;
4439  }
4440  else
4441  {
4442  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
4443  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4444  if (((model_.PBOT_i)==0.5))
4445  {
4446  dwsrh = 0;
4447  }
4448  else
4449  {
4450  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
4451  }
4452  wsrh = (wsrhstep+dwsrh);
4453  if (((model_.PBOT_i)==0.5))
4454  {
4455  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
4456  }
4457  else
4458  {
4459  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
4460  }
4461  wdep = ((model_.wdepnulrbot)*tmp);
4462  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
4463  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
4464  }
4465  if (((model_.CTATBOT_i)==0))
4466  {
4467  itat = 0;
4468  }
4469  else
4470  {
4471  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
4472  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
4473  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4474  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4475  sqrtumax = sqrt(fabs(umax));
4476  umaxpoweronepointfive = (umax*sqrtumax);
4477  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
4478  {
4479  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4480  }
4481  else
4482  {
4483  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
4484  }
4485  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4486  ktat = sqrt((0.375*(btat/sqrtumax)));
4487  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4488  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4489  xerfc = ((ltat-1)*ktat);
4490  ysq = (xerfc*xerfc);
4491  if ((xerfc>0))
4492  {
4493  terfc = (1/(1+((model_.perfc)*xerfc)));
4494  }
4495  else
4496  {
4497  terfc = (1/(1-((model_.perfc)*xerfc)));
4498  }
4499  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4500  {
4501  tmp = exp(((-ysq)+mtat));
4502  }
4503  else
4504  {
4505  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4506  }
4507  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4508  if ((xerfc>0))
4509  {
4510  erfctimesexpmtat = erfcpos;
4511  }
4512  else
4513  {
4514  if ((mtat>(-2.3025850929940458e+02)))
4515  {
4516  tmp = exp(mtat);
4517  }
4518  else
4519  {
4520  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4521  }
4522  erfctimesexpmtat = ((2*tmp)-erfcpos);
4523  }
4524  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
4525  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
4526  }
4527  if (((model_.CBBTBOT_i)==0))
4528  {
4529  ibbt = 0;
4530  }
4531  else
4532  {
4533  if (((model_.PBOT_i)==0.5))
4534  {
4535  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
4536  }
4537  else
4538  {
4539  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
4540  }
4541  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
4542  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
4543  {
4544  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
4545  }
4546  else
4547  {
4548  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
4549  {
4550  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
4551  }
4552  else
4553  {
4554  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4555  }
4556  }
4557  ibbt = ((model_.CBBTBOT_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
4558  }
4559  if (((model_.VBRBOT_i)>1000))
4560  {
4561  fbreakdown = 1;
4562  }
4563  else
4564  {
4565  if ((vav>((-0.999)*(model_.VBRBOT_i))))
4566  {
4567  if (((model_.PBRBOT_i)==4))
4568  {
4569  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
4570  }
4571  else
4572  {
4573  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
4574  }
4575  fbreakdown = (1/(1-tmp));
4576  }
4577  else
4578  {
4579  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
4580  }
4581  }
4582  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4583  }
4584  if ((LSSOURCE_i==0))
4585  {
4586  ijunsti = 0;
4587  qjunsti = 0;
4588  }
4589  else
4590  {
4591  if (((model_.one_minus_PSTI)==0.5))
4592  {
4593  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
4594  }
4595  else
4596  {
4597  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
4598  }
4599  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V2-vj)));
4600  id = ((model_.idsatsti)*idmult);
4601  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
4602  {
4603  isrh = 0;
4604  }
4605  else
4606  {
4607  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
4608  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4609  if (((model_.PSTI_i)==0.5))
4610  {
4611  dwsrh = 0;
4612  }
4613  else
4614  {
4615  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
4616  }
4617  wsrh = (wsrhstep+dwsrh);
4618  if (((model_.PSTI_i)==0.5))
4619  {
4620  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
4621  }
4622  else
4623  {
4624  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
4625  }
4626  wdep = ((model_.wdepnulrsti)*tmp);
4627  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
4628  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
4629  }
4630  if (((model_.CTATSTI_i)==0))
4631  {
4632  itat = 0;
4633  }
4634  else
4635  {
4636  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
4637  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
4638  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4639  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4640  sqrtumax = sqrt(fabs(umax));
4641  umaxpoweronepointfive = (umax*sqrtumax);
4642  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
4643  {
4644  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4645  }
4646  else
4647  {
4648  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
4649  }
4650  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4651  ktat = sqrt((0.375*(btat/sqrtumax)));
4652  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4653  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4654  xerfc = ((ltat-1)*ktat);
4655  ysq = (xerfc*xerfc);
4656  if ((xerfc>0))
4657  {
4658  terfc = (1/(1+((model_.perfc)*xerfc)));
4659  }
4660  else
4661  {
4662  terfc = (1/(1-((model_.perfc)*xerfc)));
4663  }
4664  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4665  {
4666  tmp = exp(((-ysq)+mtat));
4667  }
4668  else
4669  {
4670  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4671  }
4672  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4673  if ((xerfc>0))
4674  {
4675  erfctimesexpmtat = erfcpos;
4676  }
4677  else
4678  {
4679  if ((mtat>(-2.3025850929940458e+02)))
4680  {
4681  tmp = exp(mtat);
4682  }
4683  else
4684  {
4685  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4686  }
4687  erfctimesexpmtat = ((2*tmp)-erfcpos);
4688  }
4689  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
4690  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
4691  }
4692  if (((model_.CBBTSTI_i)==0))
4693  {
4694  ibbt = 0;
4695  }
4696  else
4697  {
4698  if (((model_.PSTI_i)==0.5))
4699  {
4700  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
4701  }
4702  else
4703  {
4704  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
4705  }
4706  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
4707  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
4708  {
4709  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
4710  }
4711  else
4712  {
4713  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
4714  {
4715  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
4716  }
4717  else
4718  {
4719  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4720  }
4721  }
4722  ibbt = ((model_.CBBTSTI_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
4723  }
4724  if (((model_.VBRSTI_i)>1000))
4725  {
4726  fbreakdown = 1;
4727  }
4728  else
4729  {
4730  if ((vav>((-0.999)*(model_.VBRSTI_i))))
4731  {
4732  if (((model_.PBRSTI_i)==4))
4733  {
4734  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
4735  }
4736  else
4737  {
4738  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
4739  }
4740  fbreakdown = (1/(1-tmp));
4741  }
4742  else
4743  {
4744  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
4745  }
4746  }
4747  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4748  }
4749  if ((LGSOURCE_i==0))
4750  {
4751  ijungat = 0;
4752  qjungat = 0;
4753  }
4754  else
4755  {
4756  if (((model_.one_minus_PGAT)==0.5))
4757  {
4758  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
4759  }
4760  else
4761  {
4762  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
4763  }
4764  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V2-vj)));
4765  id = ((model_.idsatgat)*idmult);
4766  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
4767  {
4768  isrh = 0;
4769  }
4770  else
4771  {
4772  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
4773  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4774  if (((model_.PGAT_i)==0.5))
4775  {
4776  dwsrh = 0;
4777  }
4778  else
4779  {
4780  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
4781  }
4782  wsrh = (wsrhstep+dwsrh);
4783  if (((model_.PGAT_i)==0.5))
4784  {
4785  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
4786  }
4787  else
4788  {
4789  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
4790  }
4791  wdep = ((model_.wdepnulrgat)*tmp);
4792  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
4793  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
4794  }
4795  if (((model_.CTATGAT_i)==0))
4796  {
4797  itat = 0;
4798  }
4799  else
4800  {
4801  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
4802  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
4803  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
4804  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
4805  sqrtumax = sqrt(fabs(umax));
4806  umaxpoweronepointfive = (umax*sqrtumax);
4807  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
4808  {
4809  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
4810  }
4811  else
4812  {
4813  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
4814  }
4815  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
4816  ktat = sqrt((0.375*(btat/sqrtumax)));
4817  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
4818  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
4819  xerfc = ((ltat-1)*ktat);
4820  ysq = (xerfc*xerfc);
4821  if ((xerfc>0))
4822  {
4823  terfc = (1/(1+((model_.perfc)*xerfc)));
4824  }
4825  else
4826  {
4827  terfc = (1/(1-((model_.perfc)*xerfc)));
4828  }
4829  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
4830  {
4831  tmp = exp(((-ysq)+mtat));
4832  }
4833  else
4834  {
4835  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
4836  }
4837  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
4838  if ((xerfc>0))
4839  {
4840  erfctimesexpmtat = erfcpos;
4841  }
4842  else
4843  {
4844  if ((mtat>(-2.3025850929940458e+02)))
4845  {
4846  tmp = exp(mtat);
4847  }
4848  else
4849  {
4850  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
4851  }
4852  erfctimesexpmtat = ((2*tmp)-erfcpos);
4853  }
4854  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
4855  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
4856  }
4857  if (((model_.CBBTGAT_i)==0))
4858  {
4859  ibbt = 0;
4860  }
4861  else
4862  {
4863  if (((model_.PGAT_i)==0.5))
4864  {
4865  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
4866  }
4867  else
4868  {
4869  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
4870  }
4871  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
4872  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
4873  {
4874  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
4875  }
4876  else
4877  {
4878  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
4879  {
4880  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
4881  }
4882  else
4883  {
4884  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4885  }
4886  }
4887  ibbt = ((model_.CBBTGAT_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
4888  }
4889  if (((model_.VBRGAT_i)>1000))
4890  {
4891  fbreakdown = 1;
4892  }
4893  else
4894  {
4895  if ((vav>((-0.999)*(model_.VBRGAT_i))))
4896  {
4897  if (((model_.PBRGAT_i)==4))
4898  {
4899  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
4900  }
4901  else
4902  {
4903  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
4904  }
4905  fbreakdown = (1/(1-tmp));
4906  }
4907  else
4908  {
4909  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
4910  }
4911  }
4912  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
4913  }
4914  I2 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
4915  vbbt = 0.0;
4916  two_psistar = 0.0;
4917  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
4918  {
4919  h1 = ((4.0*vch_s)*vch_s);
4920  h2 = (vch_s/vfmin_s);
4921  h2d = (V3+(vch_s*h2));
4922  h3 = (vfmin_s+h2d);
4923  h4 = (vfmin_s-h2d);
4924  h5 = sqrt(((h4*h4)+h1));
4925  vj = (2.0*((V3*vfmin_s)/(h3+h5)));
4926  if ((V3<VMAX_s))
4927  {
4928  if ((fabs((0.5*(V3*(model_.phitdinv))))<2.3025850929940458e+02))
4929  {
4930  zinv = exp((0.5*(V3*(model_.phitdinv))));
4931  }
4932  else
4933  {
4934  if (((0.5*(V3*(model_.phitdinv)))<(-2.3025850929940458e+02)))
4935  {
4936  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*3.3333333333333333e-01))))))));
4937  }
4938  else
4939  {
4940  zinv = (1.0e100*(1.0+(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
4941  }
4942  }
4943  idmult = (zinv*zinv);
4944  }
4945  else
4946  {
4947  idmult = ((1+((V3-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
4948  zinv = sqrt(idmult);
4949  }
4950  idmult = (idmult-1.0);
4951  z = (1/zinv);
4952  if ((V3>0))
4953  {
4954  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
4955  }
4956  else
4957  {
4958  two_psistar = ((-V3)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
4959  }
4960  vjlim = (vbimin_s-two_psistar);
4961  vjsrh = (0.5*((V3+vjlim)-sqrt((((V3-vjlim)*(V3-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
4962  vbbt = (0.5*((V3+vbbtlim_s)-sqrt((((V3-vbbtlim_s)*(V3-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
4963  vav = (0.5*((V3)-sqrt((((V3)*(V3))+((4*1E-6)*1E-6)))));
4964  }
4965  if ((ABSOURCE_i==0))
4966  {
4967  ijunbot = 0;
4968  qjunbot = 0;
4969  }
4970  else
4971  {
4972  if (((model_.one_minus_PBOT)==0.5))
4973  {
4974  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
4975  }
4976  else
4977  {
4978  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
4979  }
4980  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V3-vj)));
4981  id = ((model_.idsatbot)*idmult);
4982  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
4983  {
4984  isrh = 0;
4985  }
4986  else
4987  {
4988  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
4989  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
4990  if (((model_.PBOT_i)==0.5))
4991  {
4992  dwsrh = 0;
4993  }
4994  else
4995  {
4996  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
4997  }
4998  wsrh = (wsrhstep+dwsrh);
4999  if (((model_.PBOT_i)==0.5))
5000  {
5001  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
5002  }
5003  else
5004  {
5005  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
5006  }
5007  wdep = ((model_.wdepnulrbot)*tmp);
5008  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
5009  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
5010  }
5011  if (((model_.CTATBOT_i)==0))
5012  {
5013  itat = 0;
5014  }
5015  else
5016  {
5017  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
5018  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
5019  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5020  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5021  sqrtumax = sqrt(fabs(umax));
5022  umaxpoweronepointfive = (umax*sqrtumax);
5023  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
5024  {
5025  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5026  }
5027  else
5028  {
5029  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
5030  }
5031  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5032  ktat = sqrt((0.375*(btat/sqrtumax)));
5033  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5034  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5035  xerfc = ((ltat-1)*ktat);
5036  ysq = (xerfc*xerfc);
5037  if ((xerfc>0))
5038  {
5039  terfc = (1/(1+((model_.perfc)*xerfc)));
5040  }
5041  else
5042  {
5043  terfc = (1/(1-((model_.perfc)*xerfc)));
5044  }
5045  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5046  {
5047  tmp = exp(((-ysq)+mtat));
5048  }
5049  else
5050  {
5051  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5052  }
5053  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5054  if ((xerfc>0))
5055  {
5056  erfctimesexpmtat = erfcpos;
5057  }
5058  else
5059  {
5060  if ((mtat>(-2.3025850929940458e+02)))
5061  {
5062  tmp = exp(mtat);
5063  }
5064  else
5065  {
5066  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5067  }
5068  erfctimesexpmtat = ((2*tmp)-erfcpos);
5069  }
5070  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
5071  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
5072  }
5073  if (((model_.CBBTBOT_i)==0))
5074  {
5075  ibbt = 0;
5076  }
5077  else
5078  {
5079  if (((model_.PBOT_i)==0.5))
5080  {
5081  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
5082  }
5083  else
5084  {
5085  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
5086  }
5087  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
5088  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
5089  {
5090  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
5091  }
5092  else
5093  {
5094  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
5095  {
5096  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
5097  }
5098  else
5099  {
5100  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5101  }
5102  }
5103  ibbt = ((model_.CBBTBOT_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
5104  }
5105  if (((model_.VBRBOT_i)>1000))
5106  {
5107  fbreakdown = 1;
5108  }
5109  else
5110  {
5111  if ((vav>((-0.999)*(model_.VBRBOT_i))))
5112  {
5113  if (((model_.PBRBOT_i)==4))
5114  {
5115  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
5116  }
5117  else
5118  {
5119  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
5120  }
5121  fbreakdown = (1/(1-tmp));
5122  }
5123  else
5124  {
5125  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
5126  }
5127  }
5128  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5129  }
5130  if ((LSSOURCE_i==0))
5131  {
5132  ijunsti = 0;
5133  qjunsti = 0;
5134  }
5135  else
5136  {
5137  if (((model_.one_minus_PSTI)==0.5))
5138  {
5139  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
5140  }
5141  else
5142  {
5143  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
5144  }
5145  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V3-vj)));
5146  id = ((model_.idsatsti)*idmult);
5147  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
5148  {
5149  isrh = 0;
5150  }
5151  else
5152  {
5153  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
5154  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5155  if (((model_.PSTI_i)==0.5))
5156  {
5157  dwsrh = 0;
5158  }
5159  else
5160  {
5161  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
5162  }
5163  wsrh = (wsrhstep+dwsrh);
5164  if (((model_.PSTI_i)==0.5))
5165  {
5166  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
5167  }
5168  else
5169  {
5170  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
5171  }
5172  wdep = ((model_.wdepnulrsti)*tmp);
5173  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
5174  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
5175  }
5176  if (((model_.CTATSTI_i)==0))
5177  {
5178  itat = 0;
5179  }
5180  else
5181  {
5182  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
5183  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
5184  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5185  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5186  sqrtumax = sqrt(fabs(umax));
5187  umaxpoweronepointfive = (umax*sqrtumax);
5188  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
5189  {
5190  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5191  }
5192  else
5193  {
5194  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
5195  }
5196  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5197  ktat = sqrt((0.375*(btat/sqrtumax)));
5198  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5199  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5200  xerfc = ((ltat-1)*ktat);
5201  ysq = (xerfc*xerfc);
5202  if ((xerfc>0))
5203  {
5204  terfc = (1/(1+((model_.perfc)*xerfc)));
5205  }
5206  else
5207  {
5208  terfc = (1/(1-((model_.perfc)*xerfc)));
5209  }
5210  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5211  {
5212  tmp = exp(((-ysq)+mtat));
5213  }
5214  else
5215  {
5216  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5217  }
5218  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5219  if ((xerfc>0))
5220  {
5221  erfctimesexpmtat = erfcpos;
5222  }
5223  else
5224  {
5225  if ((mtat>(-2.3025850929940458e+02)))
5226  {
5227  tmp = exp(mtat);
5228  }
5229  else
5230  {
5231  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5232  }
5233  erfctimesexpmtat = ((2*tmp)-erfcpos);
5234  }
5235  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
5236  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
5237  }
5238  if (((model_.CBBTSTI_i)==0))
5239  {
5240  ibbt = 0;
5241  }
5242  else
5243  {
5244  if (((model_.PSTI_i)==0.5))
5245  {
5246  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
5247  }
5248  else
5249  {
5250  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
5251  }
5252  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
5253  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
5254  {
5255  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
5256  }
5257  else
5258  {
5259  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
5260  {
5261  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
5262  }
5263  else
5264  {
5265  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5266  }
5267  }
5268  ibbt = ((model_.CBBTSTI_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
5269  }
5270  if (((model_.VBRSTI_i)>1000))
5271  {
5272  fbreakdown = 1;
5273  }
5274  else
5275  {
5276  if ((vav>((-0.999)*(model_.VBRSTI_i))))
5277  {
5278  if (((model_.PBRSTI_i)==4))
5279  {
5280  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
5281  }
5282  else
5283  {
5284  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
5285  }
5286  fbreakdown = (1/(1-tmp));
5287  }
5288  else
5289  {
5290  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
5291  }
5292  }
5293  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5294  }
5295  if ((LGSOURCE_i==0))
5296  {
5297  ijungat = 0;
5298  qjungat = 0;
5299  }
5300  else
5301  {
5302  if (((model_.one_minus_PGAT)==0.5))
5303  {
5304  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
5305  }
5306  else
5307  {
5308  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
5309  }
5310  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V3-vj)));
5311  id = ((model_.idsatgat)*idmult);
5312  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
5313  {
5314  isrh = 0;
5315  }
5316  else
5317  {
5318  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
5319  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5320  if (((model_.PGAT_i)==0.5))
5321  {
5322  dwsrh = 0;
5323  }
5324  else
5325  {
5326  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
5327  }
5328  wsrh = (wsrhstep+dwsrh);
5329  if (((model_.PGAT_i)==0.5))
5330  {
5331  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
5332  }
5333  else
5334  {
5335  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
5336  }
5337  wdep = ((model_.wdepnulrgat)*tmp);
5338  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
5339  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
5340  }
5341  if (((model_.CTATGAT_i)==0))
5342  {
5343  itat = 0;
5344  }
5345  else
5346  {
5347  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
5348  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
5349  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5350  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5351  sqrtumax = sqrt(fabs(umax));
5352  umaxpoweronepointfive = (umax*sqrtumax);
5353  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
5354  {
5355  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5356  }
5357  else
5358  {
5359  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
5360  }
5361  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5362  ktat = sqrt((0.375*(btat/sqrtumax)));
5363  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5364  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5365  xerfc = ((ltat-1)*ktat);
5366  ysq = (xerfc*xerfc);
5367  if ((xerfc>0))
5368  {
5369  terfc = (1/(1+((model_.perfc)*xerfc)));
5370  }
5371  else
5372  {
5373  terfc = (1/(1-((model_.perfc)*xerfc)));
5374  }
5375  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5376  {
5377  tmp = exp(((-ysq)+mtat));
5378  }
5379  else
5380  {
5381  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5382  }
5383  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5384  if ((xerfc>0))
5385  {
5386  erfctimesexpmtat = erfcpos;
5387  }
5388  else
5389  {
5390  if ((mtat>(-2.3025850929940458e+02)))
5391  {
5392  tmp = exp(mtat);
5393  }
5394  else
5395  {
5396  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5397  }
5398  erfctimesexpmtat = ((2*tmp)-erfcpos);
5399  }
5400  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
5401  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
5402  }
5403  if (((model_.CBBTGAT_i)==0))
5404  {
5405  ibbt = 0;
5406  }
5407  else
5408  {
5409  if (((model_.PGAT_i)==0.5))
5410  {
5411  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
5412  }
5413  else
5414  {
5415  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
5416  }
5417  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
5418  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
5419  {
5420  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
5421  }
5422  else
5423  {
5424  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
5425  {
5426  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
5427  }
5428  else
5429  {
5430  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5431  }
5432  }
5433  ibbt = ((model_.CBBTGAT_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
5434  }
5435  if (((model_.VBRGAT_i)>1000))
5436  {
5437  fbreakdown = 1;
5438  }
5439  else
5440  {
5441  if ((vav>((-0.999)*(model_.VBRGAT_i))))
5442  {
5443  if (((model_.PBRGAT_i)==4))
5444  {
5445  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
5446  }
5447  else
5448  {
5449  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
5450  }
5451  fbreakdown = (1/(1-tmp));
5452  }
5453  else
5454  {
5455  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
5456  }
5457  }
5458  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5459  }
5460  I3 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
5461  vbbt = 0.0;
5462  two_psistar = 0.0;
5463  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
5464  {
5465  h1 = ((4.0*vch_s)*vch_s);
5466  h2 = (vch_s/vfmin_s);
5467  h2d = (V4+(vch_s*h2));
5468  h3 = (vfmin_s+h2d);
5469  h4 = (vfmin_s-h2d);
5470  h5 = sqrt(((h4*h4)+h1));
5471  vj = (2.0*((V4*vfmin_s)/(h3+h5)));
5472  if ((V4<VMAX_s))
5473  {
5474  if ((fabs((0.5*(V4*(model_.phitdinv))))<2.3025850929940458e+02))
5475  {
5476  zinv = exp((0.5*(V4*(model_.phitdinv))));
5477  }
5478  else
5479  {
5480  if (((0.5*(V4*(model_.phitdinv)))<(-2.3025850929940458e+02)))
5481  {
5482  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*3.3333333333333333e-01))))))));
5483  }
5484  else
5485  {
5486  zinv = (1.0e100*(1.0+(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5487  }
5488  }
5489  idmult = (zinv*zinv);
5490  }
5491  else
5492  {
5493  idmult = ((1+((V4-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
5494  zinv = sqrt(idmult);
5495  }
5496  idmult = (idmult-1.0);
5497  z = (1/zinv);
5498  if ((V4>0))
5499  {
5500  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
5501  }
5502  else
5503  {
5504  two_psistar = ((-V4)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
5505  }
5506  vjlim = (vbimin_s-two_psistar);
5507  vjsrh = (0.5*((V4+vjlim)-sqrt((((V4-vjlim)*(V4-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
5508  vbbt = (0.5*((V4+vbbtlim_s)-sqrt((((V4-vbbtlim_s)*(V4-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
5509  vav = (0.5*((V4)-sqrt((((V4)*(V4))+((4*1E-6)*1E-6)))));
5510  }
5511  if ((ABSOURCE_i==0))
5512  {
5513  ijunbot = 0;
5514  qjunbot = 0;
5515  }
5516  else
5517  {
5518  if (((model_.one_minus_PBOT)==0.5))
5519  {
5520  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
5521  }
5522  else
5523  {
5524  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
5525  }
5526  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V4-vj)));
5527  id = ((model_.idsatbot)*idmult);
5528  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
5529  {
5530  isrh = 0;
5531  }
5532  else
5533  {
5534  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
5535  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5536  if (((model_.PBOT_i)==0.5))
5537  {
5538  dwsrh = 0;
5539  }
5540  else
5541  {
5542  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
5543  }
5544  wsrh = (wsrhstep+dwsrh);
5545  if (((model_.PBOT_i)==0.5))
5546  {
5547  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
5548  }
5549  else
5550  {
5551  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
5552  }
5553  wdep = ((model_.wdepnulrbot)*tmp);
5554  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
5555  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
5556  }
5557  if (((model_.CTATBOT_i)==0))
5558  {
5559  itat = 0;
5560  }
5561  else
5562  {
5563  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
5564  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
5565  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5566  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5567  sqrtumax = sqrt(fabs(umax));
5568  umaxpoweronepointfive = (umax*sqrtumax);
5569  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
5570  {
5571  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5572  }
5573  else
5574  {
5575  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
5576  }
5577  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5578  ktat = sqrt((0.375*(btat/sqrtumax)));
5579  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5580  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5581  xerfc = ((ltat-1)*ktat);
5582  ysq = (xerfc*xerfc);
5583  if ((xerfc>0))
5584  {
5585  terfc = (1/(1+((model_.perfc)*xerfc)));
5586  }
5587  else
5588  {
5589  terfc = (1/(1-((model_.perfc)*xerfc)));
5590  }
5591  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5592  {
5593  tmp = exp(((-ysq)+mtat));
5594  }
5595  else
5596  {
5597  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5598  }
5599  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5600  if ((xerfc>0))
5601  {
5602  erfctimesexpmtat = erfcpos;
5603  }
5604  else
5605  {
5606  if ((mtat>(-2.3025850929940458e+02)))
5607  {
5608  tmp = exp(mtat);
5609  }
5610  else
5611  {
5612  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5613  }
5614  erfctimesexpmtat = ((2*tmp)-erfcpos);
5615  }
5616  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
5617  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
5618  }
5619  if (((model_.CBBTBOT_i)==0))
5620  {
5621  ibbt = 0;
5622  }
5623  else
5624  {
5625  if (((model_.PBOT_i)==0.5))
5626  {
5627  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
5628  }
5629  else
5630  {
5631  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
5632  }
5633  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
5634  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
5635  {
5636  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
5637  }
5638  else
5639  {
5640  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
5641  {
5642  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
5643  }
5644  else
5645  {
5646  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5647  }
5648  }
5649  ibbt = ((model_.CBBTBOT_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
5650  }
5651  if (((model_.VBRBOT_i)>1000))
5652  {
5653  fbreakdown = 1;
5654  }
5655  else
5656  {
5657  if ((vav>((-0.999)*(model_.VBRBOT_i))))
5658  {
5659  if (((model_.PBRBOT_i)==4))
5660  {
5661  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
5662  }
5663  else
5664  {
5665  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
5666  }
5667  fbreakdown = (1/(1-tmp));
5668  }
5669  else
5670  {
5671  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
5672  }
5673  }
5674  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5675  }
5676  if ((LSSOURCE_i==0))
5677  {
5678  ijunsti = 0;
5679  qjunsti = 0;
5680  }
5681  else
5682  {
5683  if (((model_.one_minus_PSTI)==0.5))
5684  {
5685  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
5686  }
5687  else
5688  {
5689  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
5690  }
5691  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V4-vj)));
5692  id = ((model_.idsatsti)*idmult);
5693  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
5694  {
5695  isrh = 0;
5696  }
5697  else
5698  {
5699  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
5700  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5701  if (((model_.PSTI_i)==0.5))
5702  {
5703  dwsrh = 0;
5704  }
5705  else
5706  {
5707  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
5708  }
5709  wsrh = (wsrhstep+dwsrh);
5710  if (((model_.PSTI_i)==0.5))
5711  {
5712  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
5713  }
5714  else
5715  {
5716  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
5717  }
5718  wdep = ((model_.wdepnulrsti)*tmp);
5719  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
5720  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
5721  }
5722  if (((model_.CTATSTI_i)==0))
5723  {
5724  itat = 0;
5725  }
5726  else
5727  {
5728  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
5729  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
5730  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5731  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5732  sqrtumax = sqrt(fabs(umax));
5733  umaxpoweronepointfive = (umax*sqrtumax);
5734  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
5735  {
5736  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5737  }
5738  else
5739  {
5740  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
5741  }
5742  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5743  ktat = sqrt((0.375*(btat/sqrtumax)));
5744  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5745  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5746  xerfc = ((ltat-1)*ktat);
5747  ysq = (xerfc*xerfc);
5748  if ((xerfc>0))
5749  {
5750  terfc = (1/(1+((model_.perfc)*xerfc)));
5751  }
5752  else
5753  {
5754  terfc = (1/(1-((model_.perfc)*xerfc)));
5755  }
5756  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5757  {
5758  tmp = exp(((-ysq)+mtat));
5759  }
5760  else
5761  {
5762  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5763  }
5764  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5765  if ((xerfc>0))
5766  {
5767  erfctimesexpmtat = erfcpos;
5768  }
5769  else
5770  {
5771  if ((mtat>(-2.3025850929940458e+02)))
5772  {
5773  tmp = exp(mtat);
5774  }
5775  else
5776  {
5777  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5778  }
5779  erfctimesexpmtat = ((2*tmp)-erfcpos);
5780  }
5781  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
5782  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
5783  }
5784  if (((model_.CBBTSTI_i)==0))
5785  {
5786  ibbt = 0;
5787  }
5788  else
5789  {
5790  if (((model_.PSTI_i)==0.5))
5791  {
5792  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
5793  }
5794  else
5795  {
5796  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
5797  }
5798  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
5799  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
5800  {
5801  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
5802  }
5803  else
5804  {
5805  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
5806  {
5807  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
5808  }
5809  else
5810  {
5811  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5812  }
5813  }
5814  ibbt = ((model_.CBBTSTI_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
5815  }
5816  if (((model_.VBRSTI_i)>1000))
5817  {
5818  fbreakdown = 1;
5819  }
5820  else
5821  {
5822  if ((vav>((-0.999)*(model_.VBRSTI_i))))
5823  {
5824  if (((model_.PBRSTI_i)==4))
5825  {
5826  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
5827  }
5828  else
5829  {
5830  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
5831  }
5832  fbreakdown = (1/(1-tmp));
5833  }
5834  else
5835  {
5836  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
5837  }
5838  }
5839  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
5840  }
5841  if ((LGSOURCE_i==0))
5842  {
5843  ijungat = 0;
5844  qjungat = 0;
5845  }
5846  else
5847  {
5848  if (((model_.one_minus_PGAT)==0.5))
5849  {
5850  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
5851  }
5852  else
5853  {
5854  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
5855  }
5856  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V4-vj)));
5857  id = ((model_.idsatgat)*idmult);
5858  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
5859  {
5860  isrh = 0;
5861  }
5862  else
5863  {
5864  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
5865  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
5866  if (((model_.PGAT_i)==0.5))
5867  {
5868  dwsrh = 0;
5869  }
5870  else
5871  {
5872  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
5873  }
5874  wsrh = (wsrhstep+dwsrh);
5875  if (((model_.PGAT_i)==0.5))
5876  {
5877  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
5878  }
5879  else
5880  {
5881  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
5882  }
5883  wdep = ((model_.wdepnulrgat)*tmp);
5884  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
5885  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
5886  }
5887  if (((model_.CTATGAT_i)==0))
5888  {
5889  itat = 0;
5890  }
5891  else
5892  {
5893  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
5894  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
5895  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
5896  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
5897  sqrtumax = sqrt(fabs(umax));
5898  umaxpoweronepointfive = (umax*sqrtumax);
5899  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
5900  {
5901  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
5902  }
5903  else
5904  {
5905  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
5906  }
5907  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
5908  ktat = sqrt((0.375*(btat/sqrtumax)));
5909  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
5910  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
5911  xerfc = ((ltat-1)*ktat);
5912  ysq = (xerfc*xerfc);
5913  if ((xerfc>0))
5914  {
5915  terfc = (1/(1+((model_.perfc)*xerfc)));
5916  }
5917  else
5918  {
5919  terfc = (1/(1-((model_.perfc)*xerfc)));
5920  }
5921  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
5922  {
5923  tmp = exp(((-ysq)+mtat));
5924  }
5925  else
5926  {
5927  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
5928  }
5929  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
5930  if ((xerfc>0))
5931  {
5932  erfctimesexpmtat = erfcpos;
5933  }
5934  else
5935  {
5936  if ((mtat>(-2.3025850929940458e+02)))
5937  {
5938  tmp = exp(mtat);
5939  }
5940  else
5941  {
5942  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
5943  }
5944  erfctimesexpmtat = ((2*tmp)-erfcpos);
5945  }
5946  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
5947  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
5948  }
5949  if (((model_.CBBTGAT_i)==0))
5950  {
5951  ibbt = 0;
5952  }
5953  else
5954  {
5955  if (((model_.PGAT_i)==0.5))
5956  {
5957  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
5958  }
5959  else
5960  {
5961  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
5962  }
5963  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
5964  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
5965  {
5966  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
5967  }
5968  else
5969  {
5970  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
5971  {
5972  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
5973  }
5974  else
5975  {
5976  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
5977  }
5978  }
5979  ibbt = ((model_.CBBTGAT_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
5980  }
5981  if (((model_.VBRGAT_i)>1000))
5982  {
5983  fbreakdown = 1;
5984  }
5985  else
5986  {
5987  if ((vav>((-0.999)*(model_.VBRGAT_i))))
5988  {
5989  if (((model_.PBRGAT_i)==4))
5990  {
5991  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
5992  }
5993  else
5994  {
5995  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
5996  }
5997  fbreakdown = (1/(1-tmp));
5998  }
5999  else
6000  {
6001  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
6002  }
6003  }
6004  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6005  }
6006  I4 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
6007  vbbt = 0.0;
6008  two_psistar = 0.0;
6009  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
6010  {
6011  h1 = ((4.0*vch_s)*vch_s);
6012  h2 = (vch_s/vfmin_s);
6013  h2d = (V5+(vch_s*h2));
6014  h3 = (vfmin_s+h2d);
6015  h4 = (vfmin_s-h2d);
6016  h5 = sqrt(((h4*h4)+h1));
6017  vj = (2.0*((V5*vfmin_s)/(h3+h5)));
6018  if ((V5<VMAX_s))
6019  {
6020  if ((fabs((0.5*(V5*(model_.phitdinv))))<2.3025850929940458e+02))
6021  {
6022  zinv = exp((0.5*(V5*(model_.phitdinv))));
6023  }
6024  else
6025  {
6026  if (((0.5*(V5*(model_.phitdinv)))<(-2.3025850929940458e+02)))
6027  {
6028  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*3.3333333333333333e-01))))))));
6029  }
6030  else
6031  {
6032  zinv = (1.0e100*(1.0+(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6033  }
6034  }
6035  idmult = (zinv*zinv);
6036  }
6037  else
6038  {
6039  idmult = ((1+((V5-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
6040  zinv = sqrt(idmult);
6041  }
6042  idmult = (idmult-1.0);
6043  z = (1/zinv);
6044  if ((V5>0))
6045  {
6046  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
6047  }
6048  else
6049  {
6050  two_psistar = ((-V5)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
6051  }
6052  vjlim = (vbimin_s-two_psistar);
6053  vjsrh = (0.5*((V5+vjlim)-sqrt((((V5-vjlim)*(V5-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
6054  vbbt = (0.5*((V5+vbbtlim_s)-sqrt((((V5-vbbtlim_s)*(V5-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
6055  vav = (0.5*((V5)-sqrt((((V5)*(V5))+((4*1E-6)*1E-6)))));
6056  }
6057  if ((ABSOURCE_i==0))
6058  {
6059  ijunbot = 0;
6060  qjunbot = 0;
6061  }
6062  else
6063  {
6064  if (((model_.one_minus_PBOT)==0.5))
6065  {
6066  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
6067  }
6068  else
6069  {
6070  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
6071  }
6072  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V5-vj)));
6073  id = ((model_.idsatbot)*idmult);
6074  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
6075  {
6076  isrh = 0;
6077  }
6078  else
6079  {
6080  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
6081  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6082  if (((model_.PBOT_i)==0.5))
6083  {
6084  dwsrh = 0;
6085  }
6086  else
6087  {
6088  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
6089  }
6090  wsrh = (wsrhstep+dwsrh);
6091  if (((model_.PBOT_i)==0.5))
6092  {
6093  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
6094  }
6095  else
6096  {
6097  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
6098  }
6099  wdep = ((model_.wdepnulrbot)*tmp);
6100  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
6101  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
6102  }
6103  if (((model_.CTATBOT_i)==0))
6104  {
6105  itat = 0;
6106  }
6107  else
6108  {
6109  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
6110  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
6111  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
6112  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
6113  sqrtumax = sqrt(fabs(umax));
6114  umaxpoweronepointfive = (umax*sqrtumax);
6115  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
6116  {
6117  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
6118  }
6119  else
6120  {
6121  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
6122  }
6123  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
6124  ktat = sqrt((0.375*(btat/sqrtumax)));
6125  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
6126  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
6127  xerfc = ((ltat-1)*ktat);
6128  ysq = (xerfc*xerfc);
6129  if ((xerfc>0))
6130  {
6131  terfc = (1/(1+((model_.perfc)*xerfc)));
6132  }
6133  else
6134  {
6135  terfc = (1/(1-((model_.perfc)*xerfc)));
6136  }
6137  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
6138  {
6139  tmp = exp(((-ysq)+mtat));
6140  }
6141  else
6142  {
6143  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
6144  }
6145  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
6146  if ((xerfc>0))
6147  {
6148  erfctimesexpmtat = erfcpos;
6149  }
6150  else
6151  {
6152  if ((mtat>(-2.3025850929940458e+02)))
6153  {
6154  tmp = exp(mtat);
6155  }
6156  else
6157  {
6158  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
6159  }
6160  erfctimesexpmtat = ((2*tmp)-erfcpos);
6161  }
6162  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
6163  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
6164  }
6165  if (((model_.CBBTBOT_i)==0))
6166  {
6167  ibbt = 0;
6168  }
6169  else
6170  {
6171  if (((model_.PBOT_i)==0.5))
6172  {
6173  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
6174  }
6175  else
6176  {
6177  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
6178  }
6179  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
6180  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
6181  {
6182  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
6183  }
6184  else
6185  {
6186  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
6187  {
6188  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
6189  }
6190  else
6191  {
6192  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6193  }
6194  }
6195  ibbt = ((model_.CBBTBOT_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
6196  }
6197  if (((model_.VBRBOT_i)>1000))
6198  {
6199  fbreakdown = 1;
6200  }
6201  else
6202  {
6203  if ((vav>((-0.999)*(model_.VBRBOT_i))))
6204  {
6205  if (((model_.PBRBOT_i)==4))
6206  {
6207  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
6208  }
6209  else
6210  {
6211  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
6212  }
6213  fbreakdown = (1/(1-tmp));
6214  }
6215  else
6216  {
6217  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
6218  }
6219  }
6220  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6221  }
6222  if ((LSSOURCE_i==0))
6223  {
6224  ijunsti = 0;
6225  qjunsti = 0;
6226  }
6227  else
6228  {
6229  if (((model_.one_minus_PSTI)==0.5))
6230  {
6231  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
6232  }
6233  else
6234  {
6235  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
6236  }
6237  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V5-vj)));
6238  id = ((model_.idsatsti)*idmult);
6239  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
6240  {
6241  isrh = 0;
6242  }
6243  else
6244  {
6245  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
6246  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6247  if (((model_.PSTI_i)==0.5))
6248  {
6249  dwsrh = 0;
6250  }
6251  else
6252  {
6253  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
6254  }
6255  wsrh = (wsrhstep+dwsrh);
6256  if (((model_.PSTI_i)==0.5))
6257  {
6258  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
6259  }
6260  else
6261  {
6262  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
6263  }
6264  wdep = ((model_.wdepnulrsti)*tmp);
6265  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
6266  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
6267  }
6268  if (((model_.CTATSTI_i)==0))
6269  {
6270  itat = 0;
6271  }
6272  else
6273  {
6274  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
6275  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
6276  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
6277  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
6278  sqrtumax = sqrt(fabs(umax));
6279  umaxpoweronepointfive = (umax*sqrtumax);
6280  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
6281  {
6282  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
6283  }
6284  else
6285  {
6286  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
6287  }
6288  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
6289  ktat = sqrt((0.375*(btat/sqrtumax)));
6290  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
6291  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
6292  xerfc = ((ltat-1)*ktat);
6293  ysq = (xerfc*xerfc);
6294  if ((xerfc>0))
6295  {
6296  terfc = (1/(1+((model_.perfc)*xerfc)));
6297  }
6298  else
6299  {
6300  terfc = (1/(1-((model_.perfc)*xerfc)));
6301  }
6302  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
6303  {
6304  tmp = exp(((-ysq)+mtat));
6305  }
6306  else
6307  {
6308  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
6309  }
6310  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
6311  if ((xerfc>0))
6312  {
6313  erfctimesexpmtat = erfcpos;
6314  }
6315  else
6316  {
6317  if ((mtat>(-2.3025850929940458e+02)))
6318  {
6319  tmp = exp(mtat);
6320  }
6321  else
6322  {
6323  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
6324  }
6325  erfctimesexpmtat = ((2*tmp)-erfcpos);
6326  }
6327  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
6328  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
6329  }
6330  if (((model_.CBBTSTI_i)==0))
6331  {
6332  ibbt = 0;
6333  }
6334  else
6335  {
6336  if (((model_.PSTI_i)==0.5))
6337  {
6338  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
6339  }
6340  else
6341  {
6342  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
6343  }
6344  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
6345  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
6346  {
6347  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
6348  }
6349  else
6350  {
6351  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
6352  {
6353  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
6354  }
6355  else
6356  {
6357  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6358  }
6359  }
6360  ibbt = ((model_.CBBTSTI_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
6361  }
6362  if (((model_.VBRSTI_i)>1000))
6363  {
6364  fbreakdown = 1;
6365  }
6366  else
6367  {
6368  if ((vav>((-0.999)*(model_.VBRSTI_i))))
6369  {
6370  if (((model_.PBRSTI_i)==4))
6371  {
6372  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
6373  }
6374  else
6375  {
6376  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
6377  }
6378  fbreakdown = (1/(1-tmp));
6379  }
6380  else
6381  {
6382  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
6383  }
6384  }
6385  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6386  }
6387  if ((LGSOURCE_i==0))
6388  {
6389  ijungat = 0;
6390  qjungat = 0;
6391  }
6392  else
6393  {
6394  if (((model_.one_minus_PGAT)==0.5))
6395  {
6396  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
6397  }
6398  else
6399  {
6400  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
6401  }
6402  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V5-vj)));
6403  id = ((model_.idsatgat)*idmult);
6404  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
6405  {
6406  isrh = 0;
6407  }
6408  else
6409  {
6410  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
6411  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6412  if (((model_.PGAT_i)==0.5))
6413  {
6414  dwsrh = 0;
6415  }
6416  else
6417  {
6418  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
6419  }
6420  wsrh = (wsrhstep+dwsrh);
6421  if (((model_.PGAT_i)==0.5))
6422  {
6423  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
6424  }
6425  else
6426  {
6427  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
6428  }
6429  wdep = ((model_.wdepnulrgat)*tmp);
6430  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
6431  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
6432  }
6433  if (((model_.CTATGAT_i)==0))
6434  {
6435  itat = 0;
6436  }
6437  else
6438  {
6439  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
6440  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
6441  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
6442  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
6443  sqrtumax = sqrt(fabs(umax));
6444  umaxpoweronepointfive = (umax*sqrtumax);
6445  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
6446  {
6447  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
6448  }
6449  else
6450  {
6451  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
6452  }
6453  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
6454  ktat = sqrt((0.375*(btat/sqrtumax)));
6455  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
6456  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
6457  xerfc = ((ltat-1)*ktat);
6458  ysq = (xerfc*xerfc);
6459  if ((xerfc>0))
6460  {
6461  terfc = (1/(1+((model_.perfc)*xerfc)));
6462  }
6463  else
6464  {
6465  terfc = (1/(1-((model_.perfc)*xerfc)));
6466  }
6467  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
6468  {
6469  tmp = exp(((-ysq)+mtat));
6470  }
6471  else
6472  {
6473  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
6474  }
6475  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
6476  if ((xerfc>0))
6477  {
6478  erfctimesexpmtat = erfcpos;
6479  }
6480  else
6481  {
6482  if ((mtat>(-2.3025850929940458e+02)))
6483  {
6484  tmp = exp(mtat);
6485  }
6486  else
6487  {
6488  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
6489  }
6490  erfctimesexpmtat = ((2*tmp)-erfcpos);
6491  }
6492  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
6493  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
6494  }
6495  if (((model_.CBBTGAT_i)==0))
6496  {
6497  ibbt = 0;
6498  }
6499  else
6500  {
6501  if (((model_.PGAT_i)==0.5))
6502  {
6503  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
6504  }
6505  else
6506  {
6507  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
6508  }
6509  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
6510  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
6511  {
6512  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
6513  }
6514  else
6515  {
6516  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
6517  {
6518  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
6519  }
6520  else
6521  {
6522  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6523  }
6524  }
6525  ibbt = ((model_.CBBTGAT_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
6526  }
6527  if (((model_.VBRGAT_i)>1000))
6528  {
6529  fbreakdown = 1;
6530  }
6531  else
6532  {
6533  if ((vav>((-0.999)*(model_.VBRGAT_i))))
6534  {
6535  if (((model_.PBRGAT_i)==4))
6536  {
6537  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
6538  }
6539  else
6540  {
6541  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
6542  }
6543  fbreakdown = (1/(1-tmp));
6544  }
6545  else
6546  {
6547  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
6548  }
6549  }
6550  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6551  }
6552  I5 = (((ABSOURCE_i*ijunbot)+(LSSOURCE_i*ijunsti))+(LGSOURCE_i*ijungat));
6554  I4_cor = (I4-(ISATFOR1_s*(exp(((V4*(model_.phitdinv))*MFOR1_s))-1.0)));
6555  I5_cor = (I5-(ISATFOR1_s*(exp(((V5*(model_.phitdinv))*MFOR1_s))-1.0)));
6556  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
6557  {
6558  if (((I4>0)&&(I5>0)))
6559  {
6560  if ((((((I4_cor/I4)>0.001)||((I5_cor/I5)>0.001))&&(I4_cor>0))&&(I5_cor>0)))
6561  {
6562  alphaje = (I4_cor/I5_cor);
6563  MFOR2_s = (((model_.phitd)*log(alphaje))/(V4-V5));
6564  ISATFOR2_s = (I4_cor/(exp(((V4*(model_.phitdinv))*MFOR2_s))-1));
6565  }
6566  }
6567  I1_cor = ((I1-(ISATFOR1_s*(exp(((V1*(model_.phitdinv))*MFOR1_s))-1.0)))-(ISATFOR2_s*(exp(((V1*(model_.phitdinv))*MFOR2_s))-1.0)));
6568  I2_cor = ((I2-(ISATFOR1_s*(exp(((V2*(model_.phitdinv))*MFOR1_s))-1.0)))-(ISATFOR2_s*(exp(((V2*(model_.phitdinv))*MFOR2_s))-1.0)));
6569  I3_cor = ((I3-(ISATFOR1_s*(exp(((V3*(model_.phitdinv))*MFOR1_s))-1.0)))-(ISATFOR2_s*(exp(((V3*(model_.phitdinv))*MFOR2_s))-1.0)));
6570  if ((((I1<0)&&(I2<0))&&(I3<0)))
6571  {
6572  if ((((((((I1_cor/I1)>0.001)||((I2_cor/I2)>0.001))||((I3_cor/I3)>0.001))&&(I1_cor<0))&&(I2_cor<0))&&(I3_cor<0)))
6573  {
6574  alphaje = (I1_cor/I2_cor);
6575  m0_rev = (((-(model_.phitd))*log(alphaje))/(V1-V2));
6576  tt0 = (V2/(V2-V1));
6577  tt1 = (((model_.phitd)*(alphaje-1))*(pow(alphaje,tt0)-1));
6578  tt0 = (V1/(V1-V2));
6579  tt2 = (((pow(alphaje,tt0)*(V2-V1))+(alphaje*V1))-V2);
6580  mcor_rev = (tt1/tt2);
6581  MREV_s = (m0_rev+mcor_rev);
6582  if ((fabs(((V3*(model_.phitdinv))*MREV_s))<1e-6))
6583  {
6584  m0flag_s = 1.0;
6585  ISATREV_s = (I3_cor*((1/V3)+((0.5*(model_.phitdinv))*MREV_s)));
6586  MREV_s = (((((-0.5)*I3_cor)*MREV_s)*(model_.phitdinv))/V3);
6587  }
6588  else
6589  {
6590  m0flag_s = 0.0;
6591  ISATREV_s = ((-I3_cor)/(exp((((-V3)*(model_.phitdinv))*MREV_s))-1));
6592  }
6593  }
6594  }
6595  }
6597  if (((ABSOURCE_i*(model_.cjobot))<=zfrac))
6598  {
6599  zflagbot_s = 0.0;
6600  }
6601  if (((LSSOURCE_i*(model_.cjosti))<=zfrac))
6602  {
6603  zflagsti_s = 0.0;
6604  }
6605  if (((LGSOURCE_i*(model_.cjogat))<=zfrac))
6606  {
6607  zflaggat_s = 0.0;
6608  }
6609  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
6610  {
6611  xhighf1_s = log(((0.5*(model_.IMAX_i))/(ISATFOR1_s+1e-21)));
6612  xhighf2_s = log(((0.5*(model_.IMAX_i))/(ISATFOR2_s+1e-21)));
6613  xhighr_s = log(((0.5*(model_.IMAX_i))/(fabs(ISATREV_s)+1e-21)));
6614  }
6615  xhighf1_s = std::min(xhighf1_s,2.3025850929940458e+02);
6616  expxhf1_s = exp(xhighf1_s);
6617  xhighf2_s = std::min(xhighf2_s,2.3025850929940458e+02);
6618  expxhf2_s = exp(xhighf2_s);
6619  xhighr_s = std::min(xhighr_s,2.3025850929940458e+02);
6620  expxhr_s = exp(xhighr_s);
6627  (model_.PBOT_i) = (model_.PBOTD_i);
6628  (model_.PSTI_i) = (model_.PSTID_i);
6629  (model_.PGAT_i) = (model_.PGATD_i);
6663  (model_.FJUNQ_i) = (model_.FJUNQD_i);
6670  (model_.ftdbot) = (model_.ftdbot_d);
6671  (model_.ftdsti) = (model_.ftdsti_d);
6672  (model_.ftdgat) = (model_.ftdgat_d);
6676  (model_.ubibot) = (model_.ubibot_d);
6677  (model_.ubisti) = (model_.ubisti_d);
6678  (model_.ubigat) = (model_.ubigat_d);
6679  (model_.vbibot) = (model_.vbibot_d);
6680  (model_.vbisti) = (model_.vbisti_d);
6681  (model_.vbigat) = (model_.vbigat_d);
6691  (model_.cjobot) = (model_.cjobot_d);
6692  (model_.cjosti) = (model_.cjosti_d);
6693  (model_.cjogat) = (model_.cjogat_d);
6733  FRACNA = 0.4;
6734  FRACNB = 0.65;
6735  FRACI = 0.8;
6736  V1 = ((-FRACNA)*(model_.VJUNREF_i));
6737  V2 = ((-FRACNB)*(model_.VJUNREF_i));
6738  V3 = ((-FRACI)*(model_.VJUNREF_i));
6739  V4 = 0.1;
6740  V5 = 0.2;
6741  vbbt = 0.0;
6742  two_psistar = 0.0;
6743  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
6744  {
6745  h1 = ((4.0*vch_d)*vch_d);
6746  h2 = (vch_d/vfmin_d);
6747  h2d = (V1+(vch_d*h2));
6748  h3 = (vfmin_d+h2d);
6749  h4 = (vfmin_d-h2d);
6750  h5 = sqrt(((h4*h4)+h1));
6751  vj = (2.0*((V1*vfmin_d)/(h3+h5)));
6752  if ((V1<VMAX_d))
6753  {
6754  if ((fabs((0.5*(V1*(model_.phitdinv))))<2.3025850929940458e+02))
6755  {
6756  zinv = exp((0.5*(V1*(model_.phitdinv))));
6757  }
6758  else
6759  {
6760  if (((0.5*(V1*(model_.phitdinv)))<(-2.3025850929940458e+02)))
6761  {
6762  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V1*(model_.phitdinv))))*3.3333333333333333e-01))))))));
6763  }
6764  else
6765  {
6766  zinv = (1.0e100*(1.0+(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V1*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6767  }
6768  }
6769  idmult = (zinv*zinv);
6770  }
6771  else
6772  {
6773  idmult = ((1+((V1-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
6774  zinv = sqrt(idmult);
6775  }
6776  idmult = (idmult-1.0);
6777  z = (1/zinv);
6778  if ((V1>0))
6779  {
6780  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
6781  }
6782  else
6783  {
6784  two_psistar = ((-V1)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
6785  }
6786  vjlim = (vbimin_d-two_psistar);
6787  vjsrh = (0.5*((V1+vjlim)-sqrt((((V1-vjlim)*(V1-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
6788  vbbt = (0.5*((V1+vbbtlim_d)-sqrt((((V1-vbbtlim_d)*(V1-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
6789  vav = (0.5*((V1)-sqrt((((V1)*(V1))+((4*1E-6)*1E-6)))));
6790  }
6791  if ((ABDRAIN_i==0))
6792  {
6793  ijunbot = 0;
6794  qjunbot = 0;
6795  }
6796  else
6797  {
6798  if (((model_.one_minus_PBOT)==0.5))
6799  {
6800  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
6801  }
6802  else
6803  {
6804  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
6805  }
6806  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V1-vj)));
6807  id = ((model_.idsatbot)*idmult);
6808  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
6809  {
6810  isrh = 0;
6811  }
6812  else
6813  {
6814  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
6815  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6816  if (((model_.PBOT_i)==0.5))
6817  {
6818  dwsrh = 0;
6819  }
6820  else
6821  {
6822  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
6823  }
6824  wsrh = (wsrhstep+dwsrh);
6825  if (((model_.PBOT_i)==0.5))
6826  {
6827  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
6828  }
6829  else
6830  {
6831  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
6832  }
6833  wdep = ((model_.wdepnulrbot)*tmp);
6834  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
6835  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
6836  }
6837  if (((model_.CTATBOT_i)==0))
6838  {
6839  itat = 0;
6840  }
6841  else
6842  {
6843  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
6844  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
6845  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
6846  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
6847  sqrtumax = sqrt(fabs(umax));
6848  umaxpoweronepointfive = (umax*sqrtumax);
6849  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
6850  {
6851  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
6852  }
6853  else
6854  {
6855  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
6856  }
6857  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
6858  ktat = sqrt((0.375*(btat/sqrtumax)));
6859  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
6860  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
6861  xerfc = ((ltat-1)*ktat);
6862  ysq = (xerfc*xerfc);
6863  if ((xerfc>0))
6864  {
6865  terfc = (1/(1+((model_.perfc)*xerfc)));
6866  }
6867  else
6868  {
6869  terfc = (1/(1-((model_.perfc)*xerfc)));
6870  }
6871  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
6872  {
6873  tmp = exp(((-ysq)+mtat));
6874  }
6875  else
6876  {
6877  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
6878  }
6879  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
6880  if ((xerfc>0))
6881  {
6882  erfctimesexpmtat = erfcpos;
6883  }
6884  else
6885  {
6886  if ((mtat>(-2.3025850929940458e+02)))
6887  {
6888  tmp = exp(mtat);
6889  }
6890  else
6891  {
6892  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
6893  }
6894  erfctimesexpmtat = ((2*tmp)-erfcpos);
6895  }
6896  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
6897  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
6898  }
6899  if (((model_.CBBTBOT_i)==0))
6900  {
6901  ibbt = 0;
6902  }
6903  else
6904  {
6905  if (((model_.PBOT_i)==0.5))
6906  {
6907  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
6908  }
6909  else
6910  {
6911  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
6912  }
6913  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
6914  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
6915  {
6916  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
6917  }
6918  else
6919  {
6920  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
6921  {
6922  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
6923  }
6924  else
6925  {
6926  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
6927  }
6928  }
6929  ibbt = ((model_.CBBTBOT_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
6930  }
6931  if (((model_.VBRBOT_i)>1000))
6932  {
6933  fbreakdown = 1;
6934  }
6935  else
6936  {
6937  if ((vav>((-0.999)*(model_.VBRBOT_i))))
6938  {
6939  if (((model_.PBRBOT_i)==4))
6940  {
6941  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
6942  }
6943  else
6944  {
6945  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
6946  }
6947  fbreakdown = (1/(1-tmp));
6948  }
6949  else
6950  {
6951  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
6952  }
6953  }
6954  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
6955  }
6956  if ((LSDRAIN_i==0))
6957  {
6958  ijunsti = 0;
6959  qjunsti = 0;
6960  }
6961  else
6962  {
6963  if (((model_.one_minus_PSTI)==0.5))
6964  {
6965  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
6966  }
6967  else
6968  {
6969  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
6970  }
6971  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V1-vj)));
6972  id = ((model_.idsatsti)*idmult);
6973  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
6974  {
6975  isrh = 0;
6976  }
6977  else
6978  {
6979  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
6980  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
6981  if (((model_.PSTI_i)==0.5))
6982  {
6983  dwsrh = 0;
6984  }
6985  else
6986  {
6987  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
6988  }
6989  wsrh = (wsrhstep+dwsrh);
6990  if (((model_.PSTI_i)==0.5))
6991  {
6992  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
6993  }
6994  else
6995  {
6996  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
6997  }
6998  wdep = ((model_.wdepnulrsti)*tmp);
6999  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
7000  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
7001  }
7002  if (((model_.CTATSTI_i)==0))
7003  {
7004  itat = 0;
7005  }
7006  else
7007  {
7008  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
7009  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
7010  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7011  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7012  sqrtumax = sqrt(fabs(umax));
7013  umaxpoweronepointfive = (umax*sqrtumax);
7014  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
7015  {
7016  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7017  }
7018  else
7019  {
7020  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
7021  }
7022  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7023  ktat = sqrt((0.375*(btat/sqrtumax)));
7024  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7025  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7026  xerfc = ((ltat-1)*ktat);
7027  ysq = (xerfc*xerfc);
7028  if ((xerfc>0))
7029  {
7030  terfc = (1/(1+((model_.perfc)*xerfc)));
7031  }
7032  else
7033  {
7034  terfc = (1/(1-((model_.perfc)*xerfc)));
7035  }
7036  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7037  {
7038  tmp = exp(((-ysq)+mtat));
7039  }
7040  else
7041  {
7042  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7043  }
7044  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7045  if ((xerfc>0))
7046  {
7047  erfctimesexpmtat = erfcpos;
7048  }
7049  else
7050  {
7051  if ((mtat>(-2.3025850929940458e+02)))
7052  {
7053  tmp = exp(mtat);
7054  }
7055  else
7056  {
7057  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7058  }
7059  erfctimesexpmtat = ((2*tmp)-erfcpos);
7060  }
7061  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
7062  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
7063  }
7064  if (((model_.CBBTSTI_i)==0))
7065  {
7066  ibbt = 0;
7067  }
7068  else
7069  {
7070  if (((model_.PSTI_i)==0.5))
7071  {
7072  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
7073  }
7074  else
7075  {
7076  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
7077  }
7078  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
7079  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
7080  {
7081  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
7082  }
7083  else
7084  {
7085  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
7086  {
7087  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
7088  }
7089  else
7090  {
7091  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7092  }
7093  }
7094  ibbt = ((model_.CBBTSTI_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
7095  }
7096  if (((model_.VBRSTI_i)>1000))
7097  {
7098  fbreakdown = 1;
7099  }
7100  else
7101  {
7102  if ((vav>((-0.999)*(model_.VBRSTI_i))))
7103  {
7104  if (((model_.PBRSTI_i)==4))
7105  {
7106  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
7107  }
7108  else
7109  {
7110  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
7111  }
7112  fbreakdown = (1/(1-tmp));
7113  }
7114  else
7115  {
7116  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
7117  }
7118  }
7119  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7120  }
7121  if ((LGDRAIN_i==0))
7122  {
7123  ijungat = 0;
7124  qjungat = 0;
7125  }
7126  else
7127  {
7128  if (((model_.one_minus_PGAT)==0.5))
7129  {
7130  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
7131  }
7132  else
7133  {
7134  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
7135  }
7136  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V1-vj)));
7137  id = ((model_.idsatgat)*idmult);
7138  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
7139  {
7140  isrh = 0;
7141  }
7142  else
7143  {
7144  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
7145  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7146  if (((model_.PGAT_i)==0.5))
7147  {
7148  dwsrh = 0;
7149  }
7150  else
7151  {
7152  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
7153  }
7154  wsrh = (wsrhstep+dwsrh);
7155  if (((model_.PGAT_i)==0.5))
7156  {
7157  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
7158  }
7159  else
7160  {
7161  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
7162  }
7163  wdep = ((model_.wdepnulrgat)*tmp);
7164  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
7165  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
7166  }
7167  if (((model_.CTATGAT_i)==0))
7168  {
7169  itat = 0;
7170  }
7171  else
7172  {
7173  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
7174  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
7175  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7176  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7177  sqrtumax = sqrt(fabs(umax));
7178  umaxpoweronepointfive = (umax*sqrtumax);
7179  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
7180  {
7181  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7182  }
7183  else
7184  {
7185  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
7186  }
7187  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7188  ktat = sqrt((0.375*(btat/sqrtumax)));
7189  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7190  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7191  xerfc = ((ltat-1)*ktat);
7192  ysq = (xerfc*xerfc);
7193  if ((xerfc>0))
7194  {
7195  terfc = (1/(1+((model_.perfc)*xerfc)));
7196  }
7197  else
7198  {
7199  terfc = (1/(1-((model_.perfc)*xerfc)));
7200  }
7201  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7202  {
7203  tmp = exp(((-ysq)+mtat));
7204  }
7205  else
7206  {
7207  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7208  }
7209  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7210  if ((xerfc>0))
7211  {
7212  erfctimesexpmtat = erfcpos;
7213  }
7214  else
7215  {
7216  if ((mtat>(-2.3025850929940458e+02)))
7217  {
7218  tmp = exp(mtat);
7219  }
7220  else
7221  {
7222  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7223  }
7224  erfctimesexpmtat = ((2*tmp)-erfcpos);
7225  }
7226  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
7227  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
7228  }
7229  if (((model_.CBBTGAT_i)==0))
7230  {
7231  ibbt = 0;
7232  }
7233  else
7234  {
7235  if (((model_.PGAT_i)==0.5))
7236  {
7237  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
7238  }
7239  else
7240  {
7241  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
7242  }
7243  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
7244  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
7245  {
7246  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
7247  }
7248  else
7249  {
7250  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
7251  {
7252  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
7253  }
7254  else
7255  {
7256  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7257  }
7258  }
7259  ibbt = ((model_.CBBTGAT_i)*(((V1*Fmaxr)*Fmaxr)*tmp));
7260  }
7261  if (((model_.VBRGAT_i)>1000))
7262  {
7263  fbreakdown = 1;
7264  }
7265  else
7266  {
7267  if ((vav>((-0.999)*(model_.VBRGAT_i))))
7268  {
7269  if (((model_.PBRGAT_i)==4))
7270  {
7271  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
7272  }
7273  else
7274  {
7275  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
7276  }
7277  fbreakdown = (1/(1-tmp));
7278  }
7279  else
7280  {
7281  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
7282  }
7283  }
7284  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7285  }
7286  I1 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
7287  vbbt = 0.0;
7288  two_psistar = 0.0;
7289  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
7290  {
7291  h1 = ((4.0*vch_d)*vch_d);
7292  h2 = (vch_d/vfmin_d);
7293  h2d = (V2+(vch_d*h2));
7294  h3 = (vfmin_d+h2d);
7295  h4 = (vfmin_d-h2d);
7296  h5 = sqrt(((h4*h4)+h1));
7297  vj = (2.0*((V2*vfmin_d)/(h3+h5)));
7298  if ((V2<VMAX_d))
7299  {
7300  if ((fabs((0.5*(V2*(model_.phitdinv))))<2.3025850929940458e+02))
7301  {
7302  zinv = exp((0.5*(V2*(model_.phitdinv))));
7303  }
7304  else
7305  {
7306  if (((0.5*(V2*(model_.phitdinv)))<(-2.3025850929940458e+02)))
7307  {
7308  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V2*(model_.phitdinv))))*3.3333333333333333e-01))))))));
7309  }
7310  else
7311  {
7312  zinv = (1.0e100*(1.0+(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V2*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7313  }
7314  }
7315  idmult = (zinv*zinv);
7316  }
7317  else
7318  {
7319  idmult = ((1+((V2-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
7320  zinv = sqrt(idmult);
7321  }
7322  idmult = (idmult-1.0);
7323  z = (1/zinv);
7324  if ((V2>0))
7325  {
7326  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
7327  }
7328  else
7329  {
7330  two_psistar = ((-V2)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
7331  }
7332  vjlim = (vbimin_d-two_psistar);
7333  vjsrh = (0.5*((V2+vjlim)-sqrt((((V2-vjlim)*(V2-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
7334  vbbt = (0.5*((V2+vbbtlim_d)-sqrt((((V2-vbbtlim_d)*(V2-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
7335  vav = (0.5*((V2)-sqrt((((V2)*(V2))+((4*1E-6)*1E-6)))));
7336  }
7337  if ((ABDRAIN_i==0))
7338  {
7339  ijunbot = 0;
7340  qjunbot = 0;
7341  }
7342  else
7343  {
7344  if (((model_.one_minus_PBOT)==0.5))
7345  {
7346  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
7347  }
7348  else
7349  {
7350  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
7351  }
7352  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V2-vj)));
7353  id = ((model_.idsatbot)*idmult);
7354  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
7355  {
7356  isrh = 0;
7357  }
7358  else
7359  {
7360  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
7361  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7362  if (((model_.PBOT_i)==0.5))
7363  {
7364  dwsrh = 0;
7365  }
7366  else
7367  {
7368  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
7369  }
7370  wsrh = (wsrhstep+dwsrh);
7371  if (((model_.PBOT_i)==0.5))
7372  {
7373  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
7374  }
7375  else
7376  {
7377  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
7378  }
7379  wdep = ((model_.wdepnulrbot)*tmp);
7380  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
7381  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
7382  }
7383  if (((model_.CTATBOT_i)==0))
7384  {
7385  itat = 0;
7386  }
7387  else
7388  {
7389  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
7390  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
7391  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7392  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7393  sqrtumax = sqrt(fabs(umax));
7394  umaxpoweronepointfive = (umax*sqrtumax);
7395  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
7396  {
7397  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7398  }
7399  else
7400  {
7401  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
7402  }
7403  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7404  ktat = sqrt((0.375*(btat/sqrtumax)));
7405  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7406  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7407  xerfc = ((ltat-1)*ktat);
7408  ysq = (xerfc*xerfc);
7409  if ((xerfc>0))
7410  {
7411  terfc = (1/(1+((model_.perfc)*xerfc)));
7412  }
7413  else
7414  {
7415  terfc = (1/(1-((model_.perfc)*xerfc)));
7416  }
7417  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7418  {
7419  tmp = exp(((-ysq)+mtat));
7420  }
7421  else
7422  {
7423  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7424  }
7425  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7426  if ((xerfc>0))
7427  {
7428  erfctimesexpmtat = erfcpos;
7429  }
7430  else
7431  {
7432  if ((mtat>(-2.3025850929940458e+02)))
7433  {
7434  tmp = exp(mtat);
7435  }
7436  else
7437  {
7438  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7439  }
7440  erfctimesexpmtat = ((2*tmp)-erfcpos);
7441  }
7442  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
7443  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
7444  }
7445  if (((model_.CBBTBOT_i)==0))
7446  {
7447  ibbt = 0;
7448  }
7449  else
7450  {
7451  if (((model_.PBOT_i)==0.5))
7452  {
7453  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
7454  }
7455  else
7456  {
7457  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
7458  }
7459  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
7460  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
7461  {
7462  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
7463  }
7464  else
7465  {
7466  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
7467  {
7468  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
7469  }
7470  else
7471  {
7472  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7473  }
7474  }
7475  ibbt = ((model_.CBBTBOT_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
7476  }
7477  if (((model_.VBRBOT_i)>1000))
7478  {
7479  fbreakdown = 1;
7480  }
7481  else
7482  {
7483  if ((vav>((-0.999)*(model_.VBRBOT_i))))
7484  {
7485  if (((model_.PBRBOT_i)==4))
7486  {
7487  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
7488  }
7489  else
7490  {
7491  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
7492  }
7493  fbreakdown = (1/(1-tmp));
7494  }
7495  else
7496  {
7497  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
7498  }
7499  }
7500  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7501  }
7502  if ((LSDRAIN_i==0))
7503  {
7504  ijunsti = 0;
7505  qjunsti = 0;
7506  }
7507  else
7508  {
7509  if (((model_.one_minus_PSTI)==0.5))
7510  {
7511  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
7512  }
7513  else
7514  {
7515  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
7516  }
7517  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V2-vj)));
7518  id = ((model_.idsatsti)*idmult);
7519  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
7520  {
7521  isrh = 0;
7522  }
7523  else
7524  {
7525  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
7526  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7527  if (((model_.PSTI_i)==0.5))
7528  {
7529  dwsrh = 0;
7530  }
7531  else
7532  {
7533  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
7534  }
7535  wsrh = (wsrhstep+dwsrh);
7536  if (((model_.PSTI_i)==0.5))
7537  {
7538  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
7539  }
7540  else
7541  {
7542  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
7543  }
7544  wdep = ((model_.wdepnulrsti)*tmp);
7545  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
7546  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
7547  }
7548  if (((model_.CTATSTI_i)==0))
7549  {
7550  itat = 0;
7551  }
7552  else
7553  {
7554  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
7555  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
7556  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7557  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7558  sqrtumax = sqrt(fabs(umax));
7559  umaxpoweronepointfive = (umax*sqrtumax);
7560  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
7561  {
7562  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7563  }
7564  else
7565  {
7566  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
7567  }
7568  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7569  ktat = sqrt((0.375*(btat/sqrtumax)));
7570  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7571  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7572  xerfc = ((ltat-1)*ktat);
7573  ysq = (xerfc*xerfc);
7574  if ((xerfc>0))
7575  {
7576  terfc = (1/(1+((model_.perfc)*xerfc)));
7577  }
7578  else
7579  {
7580  terfc = (1/(1-((model_.perfc)*xerfc)));
7581  }
7582  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7583  {
7584  tmp = exp(((-ysq)+mtat));
7585  }
7586  else
7587  {
7588  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7589  }
7590  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7591  if ((xerfc>0))
7592  {
7593  erfctimesexpmtat = erfcpos;
7594  }
7595  else
7596  {
7597  if ((mtat>(-2.3025850929940458e+02)))
7598  {
7599  tmp = exp(mtat);
7600  }
7601  else
7602  {
7603  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7604  }
7605  erfctimesexpmtat = ((2*tmp)-erfcpos);
7606  }
7607  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
7608  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
7609  }
7610  if (((model_.CBBTSTI_i)==0))
7611  {
7612  ibbt = 0;
7613  }
7614  else
7615  {
7616  if (((model_.PSTI_i)==0.5))
7617  {
7618  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
7619  }
7620  else
7621  {
7622  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
7623  }
7624  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
7625  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
7626  {
7627  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
7628  }
7629  else
7630  {
7631  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
7632  {
7633  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
7634  }
7635  else
7636  {
7637  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7638  }
7639  }
7640  ibbt = ((model_.CBBTSTI_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
7641  }
7642  if (((model_.VBRSTI_i)>1000))
7643  {
7644  fbreakdown = 1;
7645  }
7646  else
7647  {
7648  if ((vav>((-0.999)*(model_.VBRSTI_i))))
7649  {
7650  if (((model_.PBRSTI_i)==4))
7651  {
7652  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
7653  }
7654  else
7655  {
7656  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
7657  }
7658  fbreakdown = (1/(1-tmp));
7659  }
7660  else
7661  {
7662  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
7663  }
7664  }
7665  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7666  }
7667  if ((LGDRAIN_i==0))
7668  {
7669  ijungat = 0;
7670  qjungat = 0;
7671  }
7672  else
7673  {
7674  if (((model_.one_minus_PGAT)==0.5))
7675  {
7676  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
7677  }
7678  else
7679  {
7680  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
7681  }
7682  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V2-vj)));
7683  id = ((model_.idsatgat)*idmult);
7684  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
7685  {
7686  isrh = 0;
7687  }
7688  else
7689  {
7690  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
7691  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7692  if (((model_.PGAT_i)==0.5))
7693  {
7694  dwsrh = 0;
7695  }
7696  else
7697  {
7698  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
7699  }
7700  wsrh = (wsrhstep+dwsrh);
7701  if (((model_.PGAT_i)==0.5))
7702  {
7703  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
7704  }
7705  else
7706  {
7707  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
7708  }
7709  wdep = ((model_.wdepnulrgat)*tmp);
7710  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
7711  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
7712  }
7713  if (((model_.CTATGAT_i)==0))
7714  {
7715  itat = 0;
7716  }
7717  else
7718  {
7719  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
7720  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
7721  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7722  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7723  sqrtumax = sqrt(fabs(umax));
7724  umaxpoweronepointfive = (umax*sqrtumax);
7725  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
7726  {
7727  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7728  }
7729  else
7730  {
7731  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
7732  }
7733  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7734  ktat = sqrt((0.375*(btat/sqrtumax)));
7735  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7736  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7737  xerfc = ((ltat-1)*ktat);
7738  ysq = (xerfc*xerfc);
7739  if ((xerfc>0))
7740  {
7741  terfc = (1/(1+((model_.perfc)*xerfc)));
7742  }
7743  else
7744  {
7745  terfc = (1/(1-((model_.perfc)*xerfc)));
7746  }
7747  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7748  {
7749  tmp = exp(((-ysq)+mtat));
7750  }
7751  else
7752  {
7753  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7754  }
7755  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7756  if ((xerfc>0))
7757  {
7758  erfctimesexpmtat = erfcpos;
7759  }
7760  else
7761  {
7762  if ((mtat>(-2.3025850929940458e+02)))
7763  {
7764  tmp = exp(mtat);
7765  }
7766  else
7767  {
7768  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7769  }
7770  erfctimesexpmtat = ((2*tmp)-erfcpos);
7771  }
7772  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
7773  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
7774  }
7775  if (((model_.CBBTGAT_i)==0))
7776  {
7777  ibbt = 0;
7778  }
7779  else
7780  {
7781  if (((model_.PGAT_i)==0.5))
7782  {
7783  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
7784  }
7785  else
7786  {
7787  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
7788  }
7789  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
7790  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
7791  {
7792  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
7793  }
7794  else
7795  {
7796  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
7797  {
7798  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
7799  }
7800  else
7801  {
7802  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7803  }
7804  }
7805  ibbt = ((model_.CBBTGAT_i)*(((V2*Fmaxr)*Fmaxr)*tmp));
7806  }
7807  if (((model_.VBRGAT_i)>1000))
7808  {
7809  fbreakdown = 1;
7810  }
7811  else
7812  {
7813  if ((vav>((-0.999)*(model_.VBRGAT_i))))
7814  {
7815  if (((model_.PBRGAT_i)==4))
7816  {
7817  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
7818  }
7819  else
7820  {
7821  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
7822  }
7823  fbreakdown = (1/(1-tmp));
7824  }
7825  else
7826  {
7827  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
7828  }
7829  }
7830  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
7831  }
7832  I2 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
7833  vbbt = 0.0;
7834  two_psistar = 0.0;
7835  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
7836  {
7837  h1 = ((4.0*vch_d)*vch_d);
7838  h2 = (vch_d/vfmin_d);
7839  h2d = (V3+(vch_d*h2));
7840  h3 = (vfmin_d+h2d);
7841  h4 = (vfmin_d-h2d);
7842  h5 = sqrt(((h4*h4)+h1));
7843  vj = (2.0*((V3*vfmin_d)/(h3+h5)));
7844  if ((V3<VMAX_d))
7845  {
7846  if ((fabs((0.5*(V3*(model_.phitdinv))))<2.3025850929940458e+02))
7847  {
7848  zinv = exp((0.5*(V3*(model_.phitdinv))));
7849  }
7850  else
7851  {
7852  if (((0.5*(V3*(model_.phitdinv)))<(-2.3025850929940458e+02)))
7853  {
7854  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V3*(model_.phitdinv))))*3.3333333333333333e-01))))))));
7855  }
7856  else
7857  {
7858  zinv = (1.0e100*(1.0+(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V3*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
7859  }
7860  }
7861  idmult = (zinv*zinv);
7862  }
7863  else
7864  {
7865  idmult = ((1+((V3-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
7866  zinv = sqrt(idmult);
7867  }
7868  idmult = (idmult-1.0);
7869  z = (1/zinv);
7870  if ((V3>0))
7871  {
7872  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
7873  }
7874  else
7875  {
7876  two_psistar = ((-V3)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
7877  }
7878  vjlim = (vbimin_d-two_psistar);
7879  vjsrh = (0.5*((V3+vjlim)-sqrt((((V3-vjlim)*(V3-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
7880  vbbt = (0.5*((V3+vbbtlim_d)-sqrt((((V3-vbbtlim_d)*(V3-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
7881  vav = (0.5*((V3)-sqrt((((V3)*(V3))+((4*1E-6)*1E-6)))));
7882  }
7883  if ((ABDRAIN_i==0))
7884  {
7885  ijunbot = 0;
7886  qjunbot = 0;
7887  }
7888  else
7889  {
7890  if (((model_.one_minus_PBOT)==0.5))
7891  {
7892  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
7893  }
7894  else
7895  {
7896  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
7897  }
7898  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V3-vj)));
7899  id = ((model_.idsatbot)*idmult);
7900  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
7901  {
7902  isrh = 0;
7903  }
7904  else
7905  {
7906  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
7907  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
7908  if (((model_.PBOT_i)==0.5))
7909  {
7910  dwsrh = 0;
7911  }
7912  else
7913  {
7914  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
7915  }
7916  wsrh = (wsrhstep+dwsrh);
7917  if (((model_.PBOT_i)==0.5))
7918  {
7919  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
7920  }
7921  else
7922  {
7923  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
7924  }
7925  wdep = ((model_.wdepnulrbot)*tmp);
7926  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
7927  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
7928  }
7929  if (((model_.CTATBOT_i)==0))
7930  {
7931  itat = 0;
7932  }
7933  else
7934  {
7935  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
7936  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
7937  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
7938  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
7939  sqrtumax = sqrt(fabs(umax));
7940  umaxpoweronepointfive = (umax*sqrtumax);
7941  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
7942  {
7943  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
7944  }
7945  else
7946  {
7947  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
7948  }
7949  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
7950  ktat = sqrt((0.375*(btat/sqrtumax)));
7951  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
7952  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
7953  xerfc = ((ltat-1)*ktat);
7954  ysq = (xerfc*xerfc);
7955  if ((xerfc>0))
7956  {
7957  terfc = (1/(1+((model_.perfc)*xerfc)));
7958  }
7959  else
7960  {
7961  terfc = (1/(1-((model_.perfc)*xerfc)));
7962  }
7963  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
7964  {
7965  tmp = exp(((-ysq)+mtat));
7966  }
7967  else
7968  {
7969  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
7970  }
7971  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
7972  if ((xerfc>0))
7973  {
7974  erfctimesexpmtat = erfcpos;
7975  }
7976  else
7977  {
7978  if ((mtat>(-2.3025850929940458e+02)))
7979  {
7980  tmp = exp(mtat);
7981  }
7982  else
7983  {
7984  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
7985  }
7986  erfctimesexpmtat = ((2*tmp)-erfcpos);
7987  }
7988  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
7989  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
7990  }
7991  if (((model_.CBBTBOT_i)==0))
7992  {
7993  ibbt = 0;
7994  }
7995  else
7996  {
7997  if (((model_.PBOT_i)==0.5))
7998  {
7999  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
8000  }
8001  else
8002  {
8003  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
8004  }
8005  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
8006  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
8007  {
8008  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
8009  }
8010  else
8011  {
8012  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
8013  {
8014  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
8015  }
8016  else
8017  {
8018  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8019  }
8020  }
8021  ibbt = ((model_.CBBTBOT_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
8022  }
8023  if (((model_.VBRBOT_i)>1000))
8024  {
8025  fbreakdown = 1;
8026  }
8027  else
8028  {
8029  if ((vav>((-0.999)*(model_.VBRBOT_i))))
8030  {
8031  if (((model_.PBRBOT_i)==4))
8032  {
8033  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
8034  }
8035  else
8036  {
8037  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
8038  }
8039  fbreakdown = (1/(1-tmp));
8040  }
8041  else
8042  {
8043  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
8044  }
8045  }
8046  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8047  }
8048  if ((LSDRAIN_i==0))
8049  {
8050  ijunsti = 0;
8051  qjunsti = 0;
8052  }
8053  else
8054  {
8055  if (((model_.one_minus_PSTI)==0.5))
8056  {
8057  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
8058  }
8059  else
8060  {
8061  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
8062  }
8063  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V3-vj)));
8064  id = ((model_.idsatsti)*idmult);
8065  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
8066  {
8067  isrh = 0;
8068  }
8069  else
8070  {
8071  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
8072  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8073  if (((model_.PSTI_i)==0.5))
8074  {
8075  dwsrh = 0;
8076  }
8077  else
8078  {
8079  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
8080  }
8081  wsrh = (wsrhstep+dwsrh);
8082  if (((model_.PSTI_i)==0.5))
8083  {
8084  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
8085  }
8086  else
8087  {
8088  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
8089  }
8090  wdep = ((model_.wdepnulrsti)*tmp);
8091  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
8092  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
8093  }
8094  if (((model_.CTATSTI_i)==0))
8095  {
8096  itat = 0;
8097  }
8098  else
8099  {
8100  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
8101  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
8102  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8103  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8104  sqrtumax = sqrt(fabs(umax));
8105  umaxpoweronepointfive = (umax*sqrtumax);
8106  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
8107  {
8108  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8109  }
8110  else
8111  {
8112  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
8113  }
8114  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8115  ktat = sqrt((0.375*(btat/sqrtumax)));
8116  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8117  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8118  xerfc = ((ltat-1)*ktat);
8119  ysq = (xerfc*xerfc);
8120  if ((xerfc>0))
8121  {
8122  terfc = (1/(1+((model_.perfc)*xerfc)));
8123  }
8124  else
8125  {
8126  terfc = (1/(1-((model_.perfc)*xerfc)));
8127  }
8128  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8129  {
8130  tmp = exp(((-ysq)+mtat));
8131  }
8132  else
8133  {
8134  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8135  }
8136  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8137  if ((xerfc>0))
8138  {
8139  erfctimesexpmtat = erfcpos;
8140  }
8141  else
8142  {
8143  if ((mtat>(-2.3025850929940458e+02)))
8144  {
8145  tmp = exp(mtat);
8146  }
8147  else
8148  {
8149  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8150  }
8151  erfctimesexpmtat = ((2*tmp)-erfcpos);
8152  }
8153  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
8154  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
8155  }
8156  if (((model_.CBBTSTI_i)==0))
8157  {
8158  ibbt = 0;
8159  }
8160  else
8161  {
8162  if (((model_.PSTI_i)==0.5))
8163  {
8164  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
8165  }
8166  else
8167  {
8168  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
8169  }
8170  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
8171  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
8172  {
8173  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
8174  }
8175  else
8176  {
8177  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
8178  {
8179  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
8180  }
8181  else
8182  {
8183  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8184  }
8185  }
8186  ibbt = ((model_.CBBTSTI_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
8187  }
8188  if (((model_.VBRSTI_i)>1000))
8189  {
8190  fbreakdown = 1;
8191  }
8192  else
8193  {
8194  if ((vav>((-0.999)*(model_.VBRSTI_i))))
8195  {
8196  if (((model_.PBRSTI_i)==4))
8197  {
8198  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
8199  }
8200  else
8201  {
8202  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
8203  }
8204  fbreakdown = (1/(1-tmp));
8205  }
8206  else
8207  {
8208  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
8209  }
8210  }
8211  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8212  }
8213  if ((LGDRAIN_i==0))
8214  {
8215  ijungat = 0;
8216  qjungat = 0;
8217  }
8218  else
8219  {
8220  if (((model_.one_minus_PGAT)==0.5))
8221  {
8222  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
8223  }
8224  else
8225  {
8226  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
8227  }
8228  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V3-vj)));
8229  id = ((model_.idsatgat)*idmult);
8230  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
8231  {
8232  isrh = 0;
8233  }
8234  else
8235  {
8236  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
8237  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8238  if (((model_.PGAT_i)==0.5))
8239  {
8240  dwsrh = 0;
8241  }
8242  else
8243  {
8244  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
8245  }
8246  wsrh = (wsrhstep+dwsrh);
8247  if (((model_.PGAT_i)==0.5))
8248  {
8249  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
8250  }
8251  else
8252  {
8253  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
8254  }
8255  wdep = ((model_.wdepnulrgat)*tmp);
8256  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
8257  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
8258  }
8259  if (((model_.CTATGAT_i)==0))
8260  {
8261  itat = 0;
8262  }
8263  else
8264  {
8265  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
8266  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
8267  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8268  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8269  sqrtumax = sqrt(fabs(umax));
8270  umaxpoweronepointfive = (umax*sqrtumax);
8271  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
8272  {
8273  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8274  }
8275  else
8276  {
8277  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
8278  }
8279  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8280  ktat = sqrt((0.375*(btat/sqrtumax)));
8281  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8282  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8283  xerfc = ((ltat-1)*ktat);
8284  ysq = (xerfc*xerfc);
8285  if ((xerfc>0))
8286  {
8287  terfc = (1/(1+((model_.perfc)*xerfc)));
8288  }
8289  else
8290  {
8291  terfc = (1/(1-((model_.perfc)*xerfc)));
8292  }
8293  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8294  {
8295  tmp = exp(((-ysq)+mtat));
8296  }
8297  else
8298  {
8299  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8300  }
8301  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8302  if ((xerfc>0))
8303  {
8304  erfctimesexpmtat = erfcpos;
8305  }
8306  else
8307  {
8308  if ((mtat>(-2.3025850929940458e+02)))
8309  {
8310  tmp = exp(mtat);
8311  }
8312  else
8313  {
8314  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8315  }
8316  erfctimesexpmtat = ((2*tmp)-erfcpos);
8317  }
8318  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
8319  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
8320  }
8321  if (((model_.CBBTGAT_i)==0))
8322  {
8323  ibbt = 0;
8324  }
8325  else
8326  {
8327  if (((model_.PGAT_i)==0.5))
8328  {
8329  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
8330  }
8331  else
8332  {
8333  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
8334  }
8335  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
8336  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
8337  {
8338  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
8339  }
8340  else
8341  {
8342  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
8343  {
8344  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
8345  }
8346  else
8347  {
8348  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8349  }
8350  }
8351  ibbt = ((model_.CBBTGAT_i)*(((V3*Fmaxr)*Fmaxr)*tmp));
8352  }
8353  if (((model_.VBRGAT_i)>1000))
8354  {
8355  fbreakdown = 1;
8356  }
8357  else
8358  {
8359  if ((vav>((-0.999)*(model_.VBRGAT_i))))
8360  {
8361  if (((model_.PBRGAT_i)==4))
8362  {
8363  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
8364  }
8365  else
8366  {
8367  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
8368  }
8369  fbreakdown = (1/(1-tmp));
8370  }
8371  else
8372  {
8373  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
8374  }
8375  }
8376  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8377  }
8378  I3 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
8379  vbbt = 0.0;
8380  two_psistar = 0.0;
8381  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
8382  {
8383  h1 = ((4.0*vch_d)*vch_d);
8384  h2 = (vch_d/vfmin_d);
8385  h2d = (V4+(vch_d*h2));
8386  h3 = (vfmin_d+h2d);
8387  h4 = (vfmin_d-h2d);
8388  h5 = sqrt(((h4*h4)+h1));
8389  vj = (2.0*((V4*vfmin_d)/(h3+h5)));
8390  if ((V4<VMAX_d))
8391  {
8392  if ((fabs((0.5*(V4*(model_.phitdinv))))<2.3025850929940458e+02))
8393  {
8394  zinv = exp((0.5*(V4*(model_.phitdinv))));
8395  }
8396  else
8397  {
8398  if (((0.5*(V4*(model_.phitdinv)))<(-2.3025850929940458e+02)))
8399  {
8400  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V4*(model_.phitdinv))))*3.3333333333333333e-01))))))));
8401  }
8402  else
8403  {
8404  zinv = (1.0e100*(1.0+(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V4*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8405  }
8406  }
8407  idmult = (zinv*zinv);
8408  }
8409  else
8410  {
8411  idmult = ((1+((V4-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
8412  zinv = sqrt(idmult);
8413  }
8414  idmult = (idmult-1.0);
8415  z = (1/zinv);
8416  if ((V4>0))
8417  {
8418  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
8419  }
8420  else
8421  {
8422  two_psistar = ((-V4)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
8423  }
8424  vjlim = (vbimin_d-two_psistar);
8425  vjsrh = (0.5*((V4+vjlim)-sqrt((((V4-vjlim)*(V4-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
8426  vbbt = (0.5*((V4+vbbtlim_d)-sqrt((((V4-vbbtlim_d)*(V4-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
8427  vav = (0.5*((V4)-sqrt((((V4)*(V4))+((4*1E-6)*1E-6)))));
8428  }
8429  if ((ABDRAIN_i==0))
8430  {
8431  ijunbot = 0;
8432  qjunbot = 0;
8433  }
8434  else
8435  {
8436  if (((model_.one_minus_PBOT)==0.5))
8437  {
8438  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
8439  }
8440  else
8441  {
8442  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
8443  }
8444  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V4-vj)));
8445  id = ((model_.idsatbot)*idmult);
8446  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
8447  {
8448  isrh = 0;
8449  }
8450  else
8451  {
8452  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
8453  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8454  if (((model_.PBOT_i)==0.5))
8455  {
8456  dwsrh = 0;
8457  }
8458  else
8459  {
8460  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
8461  }
8462  wsrh = (wsrhstep+dwsrh);
8463  if (((model_.PBOT_i)==0.5))
8464  {
8465  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
8466  }
8467  else
8468  {
8469  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
8470  }
8471  wdep = ((model_.wdepnulrbot)*tmp);
8472  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
8473  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
8474  }
8475  if (((model_.CTATBOT_i)==0))
8476  {
8477  itat = 0;
8478  }
8479  else
8480  {
8481  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
8482  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
8483  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8484  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8485  sqrtumax = sqrt(fabs(umax));
8486  umaxpoweronepointfive = (umax*sqrtumax);
8487  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
8488  {
8489  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8490  }
8491  else
8492  {
8493  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
8494  }
8495  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8496  ktat = sqrt((0.375*(btat/sqrtumax)));
8497  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8498  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8499  xerfc = ((ltat-1)*ktat);
8500  ysq = (xerfc*xerfc);
8501  if ((xerfc>0))
8502  {
8503  terfc = (1/(1+((model_.perfc)*xerfc)));
8504  }
8505  else
8506  {
8507  terfc = (1/(1-((model_.perfc)*xerfc)));
8508  }
8509  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8510  {
8511  tmp = exp(((-ysq)+mtat));
8512  }
8513  else
8514  {
8515  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8516  }
8517  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8518  if ((xerfc>0))
8519  {
8520  erfctimesexpmtat = erfcpos;
8521  }
8522  else
8523  {
8524  if ((mtat>(-2.3025850929940458e+02)))
8525  {
8526  tmp = exp(mtat);
8527  }
8528  else
8529  {
8530  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8531  }
8532  erfctimesexpmtat = ((2*tmp)-erfcpos);
8533  }
8534  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
8535  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
8536  }
8537  if (((model_.CBBTBOT_i)==0))
8538  {
8539  ibbt = 0;
8540  }
8541  else
8542  {
8543  if (((model_.PBOT_i)==0.5))
8544  {
8545  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
8546  }
8547  else
8548  {
8549  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
8550  }
8551  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
8552  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
8553  {
8554  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
8555  }
8556  else
8557  {
8558  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
8559  {
8560  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
8561  }
8562  else
8563  {
8564  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8565  }
8566  }
8567  ibbt = ((model_.CBBTBOT_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
8568  }
8569  if (((model_.VBRBOT_i)>1000))
8570  {
8571  fbreakdown = 1;
8572  }
8573  else
8574  {
8575  if ((vav>((-0.999)*(model_.VBRBOT_i))))
8576  {
8577  if (((model_.PBRBOT_i)==4))
8578  {
8579  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
8580  }
8581  else
8582  {
8583  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
8584  }
8585  fbreakdown = (1/(1-tmp));
8586  }
8587  else
8588  {
8589  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
8590  }
8591  }
8592  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8593  }
8594  if ((LSDRAIN_i==0))
8595  {
8596  ijunsti = 0;
8597  qjunsti = 0;
8598  }
8599  else
8600  {
8601  if (((model_.one_minus_PSTI)==0.5))
8602  {
8603  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
8604  }
8605  else
8606  {
8607  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
8608  }
8609  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V4-vj)));
8610  id = ((model_.idsatsti)*idmult);
8611  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
8612  {
8613  isrh = 0;
8614  }
8615  else
8616  {
8617  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
8618  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8619  if (((model_.PSTI_i)==0.5))
8620  {
8621  dwsrh = 0;
8622  }
8623  else
8624  {
8625  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
8626  }
8627  wsrh = (wsrhstep+dwsrh);
8628  if (((model_.PSTI_i)==0.5))
8629  {
8630  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
8631  }
8632  else
8633  {
8634  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
8635  }
8636  wdep = ((model_.wdepnulrsti)*tmp);
8637  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
8638  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
8639  }
8640  if (((model_.CTATSTI_i)==0))
8641  {
8642  itat = 0;
8643  }
8644  else
8645  {
8646  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
8647  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
8648  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8649  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8650  sqrtumax = sqrt(fabs(umax));
8651  umaxpoweronepointfive = (umax*sqrtumax);
8652  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
8653  {
8654  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8655  }
8656  else
8657  {
8658  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
8659  }
8660  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8661  ktat = sqrt((0.375*(btat/sqrtumax)));
8662  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8663  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8664  xerfc = ((ltat-1)*ktat);
8665  ysq = (xerfc*xerfc);
8666  if ((xerfc>0))
8667  {
8668  terfc = (1/(1+((model_.perfc)*xerfc)));
8669  }
8670  else
8671  {
8672  terfc = (1/(1-((model_.perfc)*xerfc)));
8673  }
8674  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8675  {
8676  tmp = exp(((-ysq)+mtat));
8677  }
8678  else
8679  {
8680  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8681  }
8682  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8683  if ((xerfc>0))
8684  {
8685  erfctimesexpmtat = erfcpos;
8686  }
8687  else
8688  {
8689  if ((mtat>(-2.3025850929940458e+02)))
8690  {
8691  tmp = exp(mtat);
8692  }
8693  else
8694  {
8695  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8696  }
8697  erfctimesexpmtat = ((2*tmp)-erfcpos);
8698  }
8699  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
8700  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
8701  }
8702  if (((model_.CBBTSTI_i)==0))
8703  {
8704  ibbt = 0;
8705  }
8706  else
8707  {
8708  if (((model_.PSTI_i)==0.5))
8709  {
8710  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
8711  }
8712  else
8713  {
8714  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
8715  }
8716  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
8717  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
8718  {
8719  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
8720  }
8721  else
8722  {
8723  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
8724  {
8725  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
8726  }
8727  else
8728  {
8729  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8730  }
8731  }
8732  ibbt = ((model_.CBBTSTI_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
8733  }
8734  if (((model_.VBRSTI_i)>1000))
8735  {
8736  fbreakdown = 1;
8737  }
8738  else
8739  {
8740  if ((vav>((-0.999)*(model_.VBRSTI_i))))
8741  {
8742  if (((model_.PBRSTI_i)==4))
8743  {
8744  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
8745  }
8746  else
8747  {
8748  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
8749  }
8750  fbreakdown = (1/(1-tmp));
8751  }
8752  else
8753  {
8754  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
8755  }
8756  }
8757  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8758  }
8759  if ((LGDRAIN_i==0))
8760  {
8761  ijungat = 0;
8762  qjungat = 0;
8763  }
8764  else
8765  {
8766  if (((model_.one_minus_PGAT)==0.5))
8767  {
8768  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
8769  }
8770  else
8771  {
8772  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
8773  }
8774  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V4-vj)));
8775  id = ((model_.idsatgat)*idmult);
8776  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
8777  {
8778  isrh = 0;
8779  }
8780  else
8781  {
8782  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
8783  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
8784  if (((model_.PGAT_i)==0.5))
8785  {
8786  dwsrh = 0;
8787  }
8788  else
8789  {
8790  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
8791  }
8792  wsrh = (wsrhstep+dwsrh);
8793  if (((model_.PGAT_i)==0.5))
8794  {
8795  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
8796  }
8797  else
8798  {
8799  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
8800  }
8801  wdep = ((model_.wdepnulrgat)*tmp);
8802  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
8803  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
8804  }
8805  if (((model_.CTATGAT_i)==0))
8806  {
8807  itat = 0;
8808  }
8809  else
8810  {
8811  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
8812  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
8813  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
8814  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
8815  sqrtumax = sqrt(fabs(umax));
8816  umaxpoweronepointfive = (umax*sqrtumax);
8817  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
8818  {
8819  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
8820  }
8821  else
8822  {
8823  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
8824  }
8825  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
8826  ktat = sqrt((0.375*(btat/sqrtumax)));
8827  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
8828  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
8829  xerfc = ((ltat-1)*ktat);
8830  ysq = (xerfc*xerfc);
8831  if ((xerfc>0))
8832  {
8833  terfc = (1/(1+((model_.perfc)*xerfc)));
8834  }
8835  else
8836  {
8837  terfc = (1/(1-((model_.perfc)*xerfc)));
8838  }
8839  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
8840  {
8841  tmp = exp(((-ysq)+mtat));
8842  }
8843  else
8844  {
8845  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
8846  }
8847  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
8848  if ((xerfc>0))
8849  {
8850  erfctimesexpmtat = erfcpos;
8851  }
8852  else
8853  {
8854  if ((mtat>(-2.3025850929940458e+02)))
8855  {
8856  tmp = exp(mtat);
8857  }
8858  else
8859  {
8860  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
8861  }
8862  erfctimesexpmtat = ((2*tmp)-erfcpos);
8863  }
8864  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
8865  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
8866  }
8867  if (((model_.CBBTGAT_i)==0))
8868  {
8869  ibbt = 0;
8870  }
8871  else
8872  {
8873  if (((model_.PGAT_i)==0.5))
8874  {
8875  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
8876  }
8877  else
8878  {
8879  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
8880  }
8881  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
8882  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
8883  {
8884  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
8885  }
8886  else
8887  {
8888  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
8889  {
8890  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
8891  }
8892  else
8893  {
8894  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8895  }
8896  }
8897  ibbt = ((model_.CBBTGAT_i)*(((V4*Fmaxr)*Fmaxr)*tmp));
8898  }
8899  if (((model_.VBRGAT_i)>1000))
8900  {
8901  fbreakdown = 1;
8902  }
8903  else
8904  {
8905  if ((vav>((-0.999)*(model_.VBRGAT_i))))
8906  {
8907  if (((model_.PBRGAT_i)==4))
8908  {
8909  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
8910  }
8911  else
8912  {
8913  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
8914  }
8915  fbreakdown = (1/(1-tmp));
8916  }
8917  else
8918  {
8919  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
8920  }
8921  }
8922  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
8923  }
8924  I4 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
8925  vbbt = 0.0;
8926  two_psistar = 0.0;
8927  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
8928  {
8929  h1 = ((4.0*vch_d)*vch_d);
8930  h2 = (vch_d/vfmin_d);
8931  h2d = (V5+(vch_d*h2));
8932  h3 = (vfmin_d+h2d);
8933  h4 = (vfmin_d-h2d);
8934  h5 = sqrt(((h4*h4)+h1));
8935  vj = (2.0*((V5*vfmin_d)/(h3+h5)));
8936  if ((V5<VMAX_d))
8937  {
8938  if ((fabs((0.5*(V5*(model_.phitdinv))))<2.3025850929940458e+02))
8939  {
8940  zinv = exp((0.5*(V5*(model_.phitdinv))));
8941  }
8942  else
8943  {
8944  if (((0.5*(V5*(model_.phitdinv)))<(-2.3025850929940458e+02)))
8945  {
8946  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(V5*(model_.phitdinv))))*3.3333333333333333e-01))))))));
8947  }
8948  else
8949  {
8950  zinv = (1.0e100*(1.0+(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(V5*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
8951  }
8952  }
8953  idmult = (zinv*zinv);
8954  }
8955  else
8956  {
8957  idmult = ((1+((V5-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
8958  zinv = sqrt(idmult);
8959  }
8960  idmult = (idmult-1.0);
8961  z = (1/zinv);
8962  if ((V5>0))
8963  {
8964  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
8965  }
8966  else
8967  {
8968  two_psistar = ((-V5)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
8969  }
8970  vjlim = (vbimin_d-two_psistar);
8971  vjsrh = (0.5*((V5+vjlim)-sqrt((((V5-vjlim)*(V5-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
8972  vbbt = (0.5*((V5+vbbtlim_d)-sqrt((((V5-vbbtlim_d)*(V5-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
8973  vav = (0.5*((V5)-sqrt((((V5)*(V5))+((4*1E-6)*1E-6)))));
8974  }
8975  if ((ABDRAIN_i==0))
8976  {
8977  ijunbot = 0;
8978  qjunbot = 0;
8979  }
8980  else
8981  {
8982  if (((model_.one_minus_PBOT)==0.5))
8983  {
8984  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
8985  }
8986  else
8987  {
8988  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
8989  }
8990  qjunbot = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(V5-vj)));
8991  id = ((model_.idsatbot)*idmult);
8992  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
8993  {
8994  isrh = 0;
8995  }
8996  else
8997  {
8998  vbi_minus_vjsrh = ((model_.vbibot)-vjsrh);
8999  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
9000  if (((model_.PBOT_i)==0.5))
9001  {
9002  dwsrh = 0;
9003  }
9004  else
9005  {
9006  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
9007  }
9008  wsrh = (wsrhstep+dwsrh);
9009  if (((model_.PBOT_i)==0.5))
9010  {
9011  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
9012  }
9013  else
9014  {
9015  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
9016  }
9017  wdep = ((model_.wdepnulrbot)*tmp);
9018  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
9019  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
9020  }
9021  if (((model_.CTATBOT_i)==0))
9022  {
9023  itat = 0;
9024  }
9025  else
9026  {
9027  btat = ((model_.btatpartbot)*((wdep*(model_.one_minus_PBOT))/vbi_minus_vjsrh));
9028  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
9029  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
9030  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
9031  sqrtumax = sqrt(fabs(umax));
9032  umaxpoweronepointfive = (umax*sqrtumax);
9033  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
9034  {
9035  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
9036  }
9037  else
9038  {
9039  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
9040  }
9041  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
9042  ktat = sqrt((0.375*(btat/sqrtumax)));
9043  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
9044  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
9045  xerfc = ((ltat-1)*ktat);
9046  ysq = (xerfc*xerfc);
9047  if ((xerfc>0))
9048  {
9049  terfc = (1/(1+((model_.perfc)*xerfc)));
9050  }
9051  else
9052  {
9053  terfc = (1/(1-((model_.perfc)*xerfc)));
9054  }
9055  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
9056  {
9057  tmp = exp(((-ysq)+mtat));
9058  }
9059  else
9060  {
9061  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
9062  }
9063  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
9064  if ((xerfc>0))
9065  {
9066  erfctimesexpmtat = erfcpos;
9067  }
9068  else
9069  {
9070  if ((mtat>(-2.3025850929940458e+02)))
9071  {
9072  tmp = exp(mtat);
9073  }
9074  else
9075  {
9076  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
9077  }
9078  erfctimesexpmtat = ((2*tmp)-erfcpos);
9079  }
9080  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
9081  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
9082  }
9083  if (((model_.CBBTBOT_i)==0))
9084  {
9085  ibbt = 0;
9086  }
9087  else
9088  {
9089  if (((model_.PBOT_i)==0.5))
9090  {
9091  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
9092  }
9093  else
9094  {
9095  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
9096  }
9097  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
9098  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
9099  {
9100  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
9101  }
9102  else
9103  {
9104  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
9105  {
9106  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
9107  }
9108  else
9109  {
9110  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
9111  }
9112  }
9113  ibbt = ((model_.CBBTBOT_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
9114  }
9115  if (((model_.VBRBOT_i)>1000))
9116  {
9117  fbreakdown = 1;
9118  }
9119  else
9120  {
9121  if ((vav>((-0.999)*(model_.VBRBOT_i))))
9122  {
9123  if (((model_.PBRBOT_i)==4))
9124  {
9125  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
9126  }
9127  else
9128  {
9129  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
9130  }
9131  fbreakdown = (1/(1-tmp));
9132  }
9133  else
9134  {
9135  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
9136  }
9137  }
9138  ijunbot = ((((id+isrh)+itat)+ibbt)*fbreakdown);
9139  }
9140  if ((LSDRAIN_i==0))
9141  {
9142  ijunsti = 0;
9143  qjunsti = 0;
9144  }
9145  else
9146  {
9147  if (((model_.one_minus_PSTI)==0.5))
9148  {
9149  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
9150  }
9151  else
9152  {
9153  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
9154  }
9155  qjunsti = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(V5-vj)));
9156  id = ((model_.idsatsti)*idmult);
9157  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
9158  {
9159  isrh = 0;
9160  }
9161  else
9162  {
9163  vbi_minus_vjsrh = ((model_.vbisti)-vjsrh);
9164  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
9165  if (((model_.PSTI_i)==0.5))
9166  {
9167  dwsrh = 0;
9168  }
9169  else
9170  {
9171  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
9172  }
9173  wsrh = (wsrhstep+dwsrh);
9174  if (((model_.PSTI_i)==0.5))
9175  {
9176  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
9177  }
9178  else
9179  {
9180  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
9181  }
9182  wdep = ((model_.wdepnulrsti)*tmp);
9183  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
9184  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
9185  }
9186  if (((model_.CTATSTI_i)==0))
9187  {
9188  itat = 0;
9189  }
9190  else
9191  {
9192  btat = ((model_.btatpartsti)*((wdep*(model_.one_minus_PSTI))/vbi_minus_vjsrh));
9193  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
9194  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
9195  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
9196  sqrtumax = sqrt(fabs(umax));
9197  umaxpoweronepointfive = (umax*sqrtumax);
9198  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
9199  {
9200  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
9201  }
9202  else
9203  {
9204  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
9205  }
9206  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
9207  ktat = sqrt((0.375*(btat/sqrtumax)));
9208  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
9209  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
9210  xerfc = ((ltat-1)*ktat);
9211  ysq = (xerfc*xerfc);
9212  if ((xerfc>0))
9213  {
9214  terfc = (1/(1+((model_.perfc)*xerfc)));
9215  }
9216  else
9217  {
9218  terfc = (1/(1-((model_.perfc)*xerfc)));
9219  }
9220  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
9221  {
9222  tmp = exp(((-ysq)+mtat));
9223  }
9224  else
9225  {
9226  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
9227  }
9228  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
9229  if ((xerfc>0))
9230  {
9231  erfctimesexpmtat = erfcpos;
9232  }
9233  else
9234  {
9235  if ((mtat>(-2.3025850929940458e+02)))
9236  {
9237  tmp = exp(mtat);
9238  }
9239  else
9240  {
9241  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
9242  }
9243  erfctimesexpmtat = ((2*tmp)-erfcpos);
9244  }
9245  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
9246  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
9247  }
9248  if (((model_.CBBTSTI_i)==0))
9249  {
9250  ibbt = 0;
9251  }
9252  else
9253  {
9254  if (((model_.PSTI_i)==0.5))
9255  {
9256  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
9257  }
9258  else
9259  {
9260  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
9261  }
9262  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
9263  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
9264  {
9265  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
9266  }
9267  else
9268  {
9269  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
9270  {
9271  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
9272  }
9273  else
9274  {
9275  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
9276  }
9277  }
9278  ibbt = ((model_.CBBTSTI_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
9279  }
9280  if (((model_.VBRSTI_i)>1000))
9281  {
9282  fbreakdown = 1;
9283  }
9284  else
9285  {
9286  if ((vav>((-0.999)*(model_.VBRSTI_i))))
9287  {
9288  if (((model_.PBRSTI_i)==4))
9289  {
9290  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
9291  }
9292  else
9293  {
9294  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
9295  }
9296  fbreakdown = (1/(1-tmp));
9297  }
9298  else
9299  {
9300  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
9301  }
9302  }
9303  ijunsti = ((((id+isrh)+itat)+ibbt)*fbreakdown);
9304  }
9305  if ((LGDRAIN_i==0))
9306  {
9307  ijungat = 0;
9308  qjungat = 0;
9309  }
9310  else
9311  {
9312  if (((model_.one_minus_PGAT)==0.5))
9313  {
9314  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
9315  }
9316  else
9317  {
9318  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
9319  }
9320  qjungat = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(V5-vj)));
9321  id = ((model_.idsatgat)*idmult);
9322  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
9323  {
9324  isrh = 0;
9325  }
9326  else
9327  {
9328  vbi_minus_vjsrh = ((model_.vbigat)-vjsrh);
9329  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
9330  if (((model_.PGAT_i)==0.5))
9331  {
9332  dwsrh = 0;
9333  }
9334  else
9335  {
9336  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
9337  }
9338  wsrh = (wsrhstep+dwsrh);
9339  if (((model_.PGAT_i)==0.5))
9340  {
9341  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
9342  }
9343  else
9344  {
9345  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
9346  }
9347  wdep = ((model_.wdepnulrgat)*tmp);
9348  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
9349  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
9350  }
9351  if (((model_.CTATGAT_i)==0))
9352  {
9353  itat = 0;
9354  }
9355  else
9356  {
9357  btat = ((model_.btatpartgat)*((wdep*(model_.one_minus_PGAT))/vbi_minus_vjsrh));
9358  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
9359  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
9360  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
9361  sqrtumax = sqrt(fabs(umax));
9362  umaxpoweronepointfive = (umax*sqrtumax);
9363  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
9364  {
9365  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
9366  }
9367  else
9368  {
9369  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
9370  }
9371  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
9372  ktat = sqrt((0.375*(btat/sqrtumax)));
9373  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
9374  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
9375  xerfc = ((ltat-1)*ktat);
9376  ysq = (xerfc*xerfc);
9377  if ((xerfc>0))
9378  {
9379  terfc = (1/(1+((model_.perfc)*xerfc)));
9380  }
9381  else
9382  {
9383  terfc = (1/(1-((model_.perfc)*xerfc)));
9384  }
9385  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
9386  {
9387  tmp = exp(((-ysq)+mtat));
9388  }
9389  else
9390  {
9391  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
9392  }
9393  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
9394  if ((xerfc>0))
9395  {
9396  erfctimesexpmtat = erfcpos;
9397  }
9398  else
9399  {
9400  if ((mtat>(-2.3025850929940458e+02)))
9401  {
9402  tmp = exp(mtat);
9403  }
9404  else
9405  {
9406  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
9407  }
9408  erfctimesexpmtat = ((2*tmp)-erfcpos);
9409  }
9410  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
9411  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
9412  }
9413  if (((model_.CBBTGAT_i)==0))
9414  {
9415  ibbt = 0;
9416  }
9417  else
9418  {
9419  if (((model_.PGAT_i)==0.5))
9420  {
9421  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
9422  }
9423  else
9424  {
9425  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
9426  }
9427  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
9428  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
9429  {
9430  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
9431  }
9432  else
9433  {
9434  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
9435  {
9436  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
9437  }
9438  else
9439  {
9440  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
9441  }
9442  }
9443  ibbt = ((model_.CBBTGAT_i)*(((V5*Fmaxr)*Fmaxr)*tmp));
9444  }
9445  if (((model_.VBRGAT_i)>1000))
9446  {
9447  fbreakdown = 1;
9448  }
9449  else
9450  {
9451  if ((vav>((-0.999)*(model_.VBRGAT_i))))
9452  {
9453  if (((model_.PBRGAT_i)==4))
9454  {
9455  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
9456  }
9457  else
9458  {
9459  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
9460  }
9461  fbreakdown = (1/(1-tmp));
9462  }
9463  else
9464  {
9465  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
9466  }
9467  }
9468  ijungat = ((((id+isrh)+itat)+ibbt)*fbreakdown);
9469  }
9470  I5 = (((ABDRAIN_i*ijunbot)+(LSDRAIN_i*ijunsti))+(LGDRAIN_i*ijungat));
9472  I4_cor = (I4-(ISATFOR1_d*(exp(((V4*(model_.phitdinv))*MFOR1_d))-1.0)));
9473  I5_cor = (I5-(ISATFOR1_d*(exp(((V5*(model_.phitdinv))*MFOR1_d))-1.0)));
9474  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
9475  {
9476  if (((I4>0)&&(I5>0)))
9477  {
9478  if ((((((I4_cor/I4)>0.001)||((I5_cor/I5)>0.001))&&(I4_cor>0))&&(I5_cor>0)))
9479  {
9480  alphaje = (I4_cor/I5_cor);
9481  MFOR2_d = (((model_.phitd)*log(alphaje))/(V4-V5));
9482  ISATFOR2_d = (I4_cor/(exp(((V4*(model_.phitdinv))*MFOR2_d))-1));
9483  }
9484  }
9485  I1_cor = ((I1-(ISATFOR1_d*(exp(((V1*(model_.phitdinv))*MFOR1_d))-1.0)))-(ISATFOR2_d*(exp(((V1*(model_.phitdinv))*MFOR2_d))-1.0)));
9486  I2_cor = ((I2-(ISATFOR1_d*(exp(((V2*(model_.phitdinv))*MFOR1_d))-1.0)))-(ISATFOR2_d*(exp(((V2*(model_.phitdinv))*MFOR2_d))-1.0)));
9487  I3_cor = ((I3-(ISATFOR1_d*(exp(((V3*(model_.phitdinv))*MFOR1_d))-1.0)))-(ISATFOR2_d*(exp(((V3*(model_.phitdinv))*MFOR2_d))-1.0)));
9488  if ((((I1<0)&&(I2<0))&&(I3<0)))
9489  {
9490  if ((((((((I1_cor/I1)>0.001)||((I2_cor/I2)>0.001))||((I3_cor/I3)>0.001))&&(I1_cor<0))&&(I2_cor<0))&&(I3_cor<0)))
9491  {
9492  alphaje = (I1_cor/I2_cor);
9493  m0_rev = (((-(model_.phitd))*log(alphaje))/(V1-V2));
9494  tt0 = (V2/(V2-V1));
9495  tt1 = (((model_.phitd)*(alphaje-1))*(pow(alphaje,tt0)-1));
9496  tt0 = (V1/(V1-V2));
9497  tt2 = (((pow(alphaje,tt0)*(V2-V1))+(alphaje*V1))-V2);
9498  mcor_rev = (tt1/tt2);
9499  MREV_d = (m0_rev+mcor_rev);
9500  if ((fabs(((V3*(model_.phitdinv))*MREV_d))<1e-6))
9501  {
9502  m0flag_d = 1.0;
9503  ISATREV_d = (I3_cor*((1/V3)+((0.5*(model_.phitdinv))*MREV_d)));
9504  MREV_d = (((((-0.5)*I3_cor)*MREV_d)*(model_.phitdinv))/V3);
9505  }
9506  else
9507  {
9508  m0flag_d = 0.0;
9509  ISATREV_d = ((-I3_cor)/(exp((((-V3)*(model_.phitdinv))*MREV_d))-1));
9510  }
9511  }
9512  }
9513  }
9515  if (((ABDRAIN_i*(model_.cjobot))<=zfrac))
9516  {
9517  zflagbot_d = 0.0;
9518  }
9519  if (((LSDRAIN_i*(model_.cjosti))<=zfrac))
9520  {
9521  zflagsti_d = 0.0;
9522  }
9523  if (((LGDRAIN_i*(model_.cjogat))<=zfrac))
9524  {
9525  zflaggat_d = 0.0;
9526  }
9527  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
9528  {
9529  xhighf1_d = log(((0.5*(model_.IMAX_i))/(ISATFOR1_d+1e-21)));
9530  xhighf2_d = log(((0.5*(model_.IMAX_i))/(ISATFOR2_d+1e-21)));
9531  xhighr_d = log(((0.5*(model_.IMAX_i))/(fabs(ISATREV_d)+1e-21)));
9532  }
9533  xhighf1_d = std::min(xhighf1_d,2.3025850929940458e+02);
9534  expxhf1_d = exp(xhighf1_d);
9535  xhighf2_d = std::min(xhighf2_d,2.3025850929940458e+02);
9536  expxhf2_d = exp(xhighf2_d);
9537  xhighr_d = std::min(xhighr_d,2.3025850929940458e+02);
9538  expxhr_d = exp(xhighr_d);
9539  }
9540  // End block JUNCAPexpressInit
9541  }
9542  }
9543  // End block initial_instance
9544 
9545 
9546  return true;
9547 }
9548 
9549 //-----------------------------------------------------------------------------
9550 // Function : Instance::Instance
9551 // Purpose : "instance block" constructor
9552 // Special Notes :
9553 // Scope : public
9554 // Creator : admsXml
9555 // Creation Date :
9556 //-----------------------------------------------------------------------------
9557 
9559  const Configuration & configuration,
9560  const InstanceBlock & instance_block,
9561  Model & model,
9562  const FactoryBlock & factory_block)
9563  : DeviceInstance(instance_block, configuration.getInstanceParameters(), factory_block),
9564  model_(model),
9565  L(10e-6),
9566  W(10e-6),
9567  SA(0.0),
9568  SB(0.0),
9569  SD(0.0),
9570  SCA(0.0),
9571  SCB(0.0),
9572  SCC(0.0),
9573  SC(0.0),
9574  NF(1.0),
9575  NGCON(1.0),
9576  XGW(1.0E-7),
9577  NRS(0.0),
9578  NRD(0.0),
9579  JW(1E-6),
9580  DELVTO(0.0),
9581  FACTUO(1.0),
9582  ABSOURCE(1E-12),
9583  LSSOURCE(1E-6),
9584  LGSOURCE(1E-6),
9585  ABDRAIN(1E-12),
9586  LSDRAIN(1E-6),
9587  LGDRAIN(1E-6),
9588  AS(1E-12),
9589  PS(1E-6),
9590  AD(1E-12),
9591  PD(1E-6),
9592  MULT(1.0),
9593  VFB_i(0.0),
9594  GFACNUD_i(0.0),
9595  VNSUB_i(0.0),
9596  NSLP_i(0.0),
9597  DNSUB_i(0.0),
9598  CF_i(0.0),
9599  CFB_i(0.0),
9600  MUE_i(0.0),
9601  THEMU_i(0.0),
9602  CS_i(0.0),
9603  XCOR_i(0.0),
9604  THER_i(0.0),
9605  RSB_i(0.0),
9606  RSG_i(0.0),
9607  THESAT_i(0.0),
9608  THESATB_i(0.0),
9609  THESATG_i(0.0),
9610  AX_i(0.0),
9611  ALP_i(0.0),
9612  ALP1_i(0.0),
9613  ALP2_i(0.0),
9614  A1_i(0.0),
9615  A2_i(0.0),
9616  A3_i(0.0),
9617  A4_i(0.0),
9618  IGINV_i(0.0),
9619  IGOV_i(0.0),
9620  IGOVD_i(0.0),
9621  GC2_i(0.0),
9622  GC3_i(0.0),
9623  CHIB_i(0.0),
9624  AGIDL_i(0.0),
9625  BGIDL_i(0.0),
9626  CGIDL_i(0.0),
9627  AGIDLD_i(0.0),
9628  BGIDLD_i(0.0),
9629  CGIDLD_i(0.0),
9630  COX_i(0.0),
9631  CGOV_i(0.0),
9632  CGOVD_i(0.0),
9633  CGBOV_i(0.0),
9634  CFR_i(0.0),
9635  CFRD_i(0.0),
9636  MULT_i(0.0),
9637  BET_i(0.0),
9638  kp(0.0),
9639  qq(0.0),
9640  qlim2(0.0),
9641  E_eff0(0.0),
9642  eta_mu(0.0),
9643  eta_mu1(0.0),
9644  BCH(0.0),
9645  BOV(0.0),
9646  inv_CHIB(0.0),
9647  GCQ(0.0),
9648  Dch(0.0),
9649  Dov(0.0),
9650  x1(0.0),
9651  Vdsat_lim(0.0),
9652  GOV_s(0.0),
9653  GOV_d(0.0),
9654  GOV2_s(0.0),
9655  GOV2_d(0.0),
9656  BOV_d(0.0),
9657  xi_ov_s(0.0),
9658  xi_ov_d(0.0),
9659  inv_xi_ov_s(0.0),
9660  inv_xi_ov_d(0.0),
9661  x_mrg_ov_s(0.0),
9662  x_mrg_ov_d(0.0),
9663  inv_xg1_s(0.0),
9664  inv_xg1_d(0.0),
9665  phit1(0.0),
9666  inv_phit1(0.0),
9667  alpha_b(0.0),
9668  inv_VP(0.0),
9669  inv_AX(0.0),
9670  us1(0.0),
9671  us21(0.0),
9672  phib_dc(0.0),
9673  sqrt_phib_dc(0.0),
9674  G_0_dc(0.0),
9675  aphi_dc(0.0),
9676  bphi_dc(0.0),
9677  phix_dc(0.0),
9678  phix1_dc(0.0),
9679  phib_ac(0.0),
9680  sqrt_phib_ac(0.0),
9681  G_0_ac(0.0),
9682  aphi_ac(0.0),
9683  bphi_ac(0.0),
9684  phix_ac(0.0),
9685  phix1_ac(0.0),
9686  RG_i(0.0),
9687  RSE_i(0.0),
9688  RDE_i(0.0),
9689  RBULK_i(0.0),
9690  RWELL_i(0.0),
9691  RJUNS_i(0.0),
9692  RJUND_i(0.0),
9693  ggate(0.0),
9694  gsource(0.0),
9695  gdrain(0.0),
9696  gbulk(0.0),
9697  gwell(0.0),
9698  gjund(0.0),
9699  gjuns(0.0),
9700  tmpv(0.0),
9701  vjv(0.0),
9702  idmult(0.0),
9703  vj(0.0),
9704  zinv(0.0),
9705  vjsrh(0.0),
9706  vav(0.0),
9707  vbi_minus_vjsrh(0.0),
9708  wsrh(0.0),
9709  wdep(0.0),
9710  asrh(0.0),
9711  ABSOURCE_i(0.0),
9712  LSSOURCE_i(0.0),
9713  LGSOURCE_i(0.0),
9714  zflagbot_s(0.0),
9715  zflagsti_s(0.0),
9716  zflaggat_s(0.0),
9717  VMAX_s(0.0),
9718  exp_VMAX_over_phitd_s(0.0),
9719  vbimin_s(0.0),
9720  vch_s(0.0),
9721  vfmin_s(0.0),
9722  vbbtlim_s(0.0),
9723  ijunbot_s(0.0),
9724  qjunbot_s(0.0),
9725  ijunsti_s(0.0),
9726  qjunsti_s(0.0),
9727  ijungat_s(0.0),
9728  qjungat_s(0.0),
9729  ijun_s(0.0),
9730  qjun_s(0.0),
9731  xhighf1_s(0.0),
9732  expxhf1_s(0.0),
9733  xhighf2_s(0.0),
9734  expxhf2_s(0.0),
9735  xhighr_s(0.0),
9736  expxhr_s(0.0),
9737  m0flag_s(0.0),
9738  ISATFOR1_s(0.0),
9739  MFOR1_s(0.0),
9740  ISATFOR2_s(0.0),
9741  MFOR2_s(0.0),
9742  ISATREV_s(0.0),
9743  MREV_s(0.0),
9744  ABDRAIN_i(0.0),
9745  LSDRAIN_i(0.0),
9746  LGDRAIN_i(0.0),
9747  zflagbot_d(0.0),
9748  zflagsti_d(0.0),
9749  zflaggat_d(0.0),
9750  VMAX_d(0.0),
9751  exp_VMAX_over_phitd_d(0.0),
9752  vbimin_d(0.0),
9753  vch_d(0.0),
9754  vfmin_d(0.0),
9755  vbbtlim_d(0.0),
9756  ijunbot_d(0.0),
9757  qjunbot_d(0.0),
9758  ijunsti_d(0.0),
9759  qjunsti_d(0.0),
9760  ijungat_d(0.0),
9761  qjungat_d(0.0),
9762  ijun_d(0.0),
9763  qjun_d(0.0),
9764  xhighf1_d(0.0),
9765  expxhf1_d(0.0),
9766  xhighf2_d(0.0),
9767  expxhf2_d(0.0),
9768  xhighr_d(0.0),
9769  expxhr_d(0.0),
9770  m0flag_d(0.0),
9771  ISATFOR1_d(0.0),
9772  MFOR1_d(0.0),
9773  ISATFOR2_d(0.0),
9774  MFOR2_d(0.0),
9775  ISATREV_d(0.0),
9776  MREV_d(0.0),
9777  li_D(-1),
9778  li_G(-1),
9779  li_S(-1),
9780  li_B(-1),
9781  li_GP(-1),
9782  li_SI(-1),
9783  li_DI(-1),
9784  li_BI(-1),
9785  li_BP(-1),
9786  li_BS(-1),
9787  li_BD(-1),
9788  f_DI_Equ_SI_Node_Ptr(0),
9789  f_DI_Equ_BP_Node_Ptr(0),
9790  f_BP_Equ_SI_Node_Ptr(0),
9791  f_BP_Equ_BP_Node_Ptr(0),
9792  f_DI_Equ_GP_Node_Ptr(0),
9793  f_BP_Equ_GP_Node_Ptr(0),
9794  f_DI_Equ_DI_Node_Ptr(0),
9795  f_BP_Equ_DI_Node_Ptr(0),
9796  f_SI_Equ_SI_Node_Ptr(0),
9797  f_SI_Equ_BP_Node_Ptr(0),
9798  f_SI_Equ_GP_Node_Ptr(0),
9799  f_SI_Equ_DI_Node_Ptr(0),
9800  f_GP_Equ_SI_Node_Ptr(0),
9801  f_GP_Equ_BP_Node_Ptr(0),
9802  f_GP_Equ_DI_Node_Ptr(0),
9803  f_GP_Equ_GP_Node_Ptr(0),
9804  f_BS_Equ_SI_Node_Ptr(0),
9805  f_BS_Equ_BS_Node_Ptr(0),
9806  f_SI_Equ_BS_Node_Ptr(0),
9807  f_BS_Equ_DI_Node_Ptr(0),
9808  f_BS_Equ_BD_Node_Ptr(0),
9809  f_SI_Equ_BD_Node_Ptr(0),
9810  f_BD_Equ_SI_Node_Ptr(0),
9811  f_BD_Equ_BS_Node_Ptr(0),
9812  f_DI_Equ_BS_Node_Ptr(0),
9813  f_BD_Equ_DI_Node_Ptr(0),
9814  f_BD_Equ_BD_Node_Ptr(0),
9815  f_DI_Equ_BD_Node_Ptr(0),
9816  f_G_Equ_G_Node_Ptr(0),
9817  f_G_Equ_GP_Node_Ptr(0),
9818  f_GP_Equ_G_Node_Ptr(0),
9819  f_S_Equ_S_Node_Ptr(0),
9820  f_S_Equ_SI_Node_Ptr(0),
9821  f_SI_Equ_S_Node_Ptr(0),
9822  f_D_Equ_D_Node_Ptr(0),
9823  f_D_Equ_DI_Node_Ptr(0),
9824  f_DI_Equ_D_Node_Ptr(0),
9825  f_BP_Equ_BI_Node_Ptr(0),
9826  f_BI_Equ_BP_Node_Ptr(0),
9827  f_BI_Equ_BI_Node_Ptr(0),
9828  f_BS_Equ_BI_Node_Ptr(0),
9829  f_BI_Equ_BS_Node_Ptr(0),
9830  f_BD_Equ_BI_Node_Ptr(0),
9831  f_BI_Equ_BD_Node_Ptr(0),
9832  f_B_Equ_B_Node_Ptr(0),
9833  f_B_Equ_BI_Node_Ptr(0),
9834  f_BI_Equ_B_Node_Ptr(0),
9835  q_DI_Equ_SI_Node_Ptr(0),
9836  q_DI_Equ_BP_Node_Ptr(0),
9837  q_BP_Equ_SI_Node_Ptr(0),
9838  q_BP_Equ_BP_Node_Ptr(0),
9839  q_DI_Equ_GP_Node_Ptr(0),
9840  q_BP_Equ_GP_Node_Ptr(0),
9841  q_DI_Equ_DI_Node_Ptr(0),
9842  q_BP_Equ_DI_Node_Ptr(0),
9843  q_SI_Equ_SI_Node_Ptr(0),
9844  q_SI_Equ_BP_Node_Ptr(0),
9845  q_SI_Equ_GP_Node_Ptr(0),
9846  q_SI_Equ_DI_Node_Ptr(0),
9847  q_GP_Equ_SI_Node_Ptr(0),
9848  q_GP_Equ_BP_Node_Ptr(0),
9849  q_GP_Equ_DI_Node_Ptr(0),
9850  q_GP_Equ_GP_Node_Ptr(0),
9851  q_BS_Equ_SI_Node_Ptr(0),
9852  q_BS_Equ_BS_Node_Ptr(0),
9853  q_SI_Equ_BS_Node_Ptr(0),
9854  q_BS_Equ_DI_Node_Ptr(0),
9855  q_BS_Equ_BD_Node_Ptr(0),
9856  q_SI_Equ_BD_Node_Ptr(0),
9857  q_BD_Equ_SI_Node_Ptr(0),
9858  q_BD_Equ_BS_Node_Ptr(0),
9859  q_DI_Equ_BS_Node_Ptr(0),
9860  q_BD_Equ_DI_Node_Ptr(0),
9861  q_BD_Equ_BD_Node_Ptr(0),
9862  q_DI_Equ_BD_Node_Ptr(0),
9863  q_G_Equ_G_Node_Ptr(0),
9864  q_G_Equ_GP_Node_Ptr(0),
9865  q_GP_Equ_G_Node_Ptr(0),
9866  q_S_Equ_S_Node_Ptr(0),
9867  q_S_Equ_SI_Node_Ptr(0),
9868  q_SI_Equ_S_Node_Ptr(0),
9869  q_D_Equ_D_Node_Ptr(0),
9870  q_D_Equ_DI_Node_Ptr(0),
9871  q_DI_Equ_D_Node_Ptr(0),
9872  q_BP_Equ_BI_Node_Ptr(0),
9873  q_BI_Equ_BP_Node_Ptr(0),
9874  q_BI_Equ_BI_Node_Ptr(0),
9875  q_BS_Equ_BI_Node_Ptr(0),
9876  q_BI_Equ_BS_Node_Ptr(0),
9877  q_BD_Equ_BI_Node_Ptr(0),
9878  q_BI_Equ_BD_Node_Ptr(0),
9879  q_B_Equ_B_Node_Ptr(0),
9880  q_B_Equ_BI_Node_Ptr(0),
9881  q_BI_Equ_B_Node_Ptr(0),
9882  admsTemperature(getDeviceOptions().temp.getImmutableValue<double>())
9883 
9884 {
9885  numIntVars = 7 + 0;
9886  numExtVars = 4;
9887 
9888 
9889  // Right now, we only have state for limited probes...
9890  numStateVars = 0;
9891 
9892 
9893  // Set up jacobian stamp:
9894 
9895  if (jacStamp.empty())
9896  {
9897  jacStamp.resize(11);
9898  jacStamp[admsNodeID_D].resize(2);
9901  jacStamp[admsNodeID_G].resize(2);
9904  jacStamp[admsNodeID_S].resize(2);
9907  jacStamp[admsNodeID_B].resize(2);
9910  jacStamp[admsNodeID_GP].resize(5);
9916  jacStamp[admsNodeID_SI].resize(7);
9924  jacStamp[admsNodeID_DI].resize(7);
9932  jacStamp[admsNodeID_BI].resize(5);
9938  jacStamp[admsNodeID_BP].resize(5);
9944  jacStamp[admsNodeID_BS].resize(5);
9950  jacStamp[admsNodeID_BD].resize(5);
9956 
9957 
9958  // This is really not strictly necessary when not mapping away nodes,
9959  // but makes life easier when we get to registerJacLIDs. This block
9960  // simply makes a map that leaves everything in place. Later, when we
9961  // start making nodes go away, we will need to modify this.
9962 
9963  int mapSize = jacStamp.size();
9964  jacMap.clear();
9965  jacMap2.clear();
9966  jacMap.resize(mapSize);
9967  jacMap2.resize(mapSize);
9968  for (int i=0;i<mapSize;++i)
9969  {
9970  int rowSize=jacStamp[i].size();
9971  jacMap[i]=i;
9972  jacMap2[i].resize(rowSize);
9973  for (int j=0;j<rowSize;++j)
9974  {
9975  jacMap2[i][j] = j;
9976  }
9977  }
9978 
9979  }
9980 
9981 
9982  setDefaultParams();
9983  setParams(instance_block.params);
9984  // set any non-constant parameter defaults
9985 
9986  // copy any model variables that have associated instance variables, but
9987  // are only given in the model card:
9988 
9989 
9990 
9991  // Set any parameters that were not given and whose defaults depend on other
9992  // parameters:
9993 
9994 
9995  // Real bogosity here...
9996  if (!given("XYCEADMSINSTTEMP"))
9997  admsInstTemp=getDeviceOptions().temp.getImmutableValue<double>();
9998 
9999  //calculate any parameters specified as expressions
10001 
10002  // calculate dependent (i.e. computed params) and check for errors.
10003  processParams();
10004  collapseNodes();
10005 }
10006 
10007 //-----------------------------------------------------------------------------
10008 // Function : Instance::collapseNodes
10009 // Purpose : function to handle collapsing of nodes
10010 // Special Notes :
10011 // Scope : public
10012 // Creator : admsXml
10013 // Creation Date :
10014 //-----------------------------------------------------------------------------
10016 {
10017  // Many, many lines of unnecessary and incorrect code manually deleted.
10018 
10019  if (!((RG_i>0.0)))
10020  {
10021 
10022  collapseNode_GP = true;
10023 
10024  }
10025 
10026  if (!((RSE_i>0.0)))
10027  {
10028 
10029  collapseNode_SI = true;
10030 
10031  }
10032 
10033  if (!((RDE_i>0.0)))
10034  {
10035 
10036  collapseNode_DI = true;
10037 
10038  }
10039 
10040  if (!((RBULK_i>0.0)))
10041  {
10042 
10043  collapseNode_BP = true;
10044 
10045  }
10046 
10047  if (!((RJUNS_i>0.0)))
10048  {
10049 
10050  collapseNode_BS = true;
10051 
10052  }
10053 
10054  if (!((RJUND_i>0.0)))
10055  {
10056 
10057  collapseNode_BD = true;
10058 
10059  }
10060 
10061  if (!((RWELL_i>0.0)))
10062  {
10063 
10064  collapseNode_BI = true;
10065 
10066  }
10067 
10068  // end block named loadStatic
10069 
10070 
10071 
10072  // Map away any unneeded internal nodes:
10073  // temporary stamps and maps
10074  std::vector< std::vector<int> > tempStamp;
10075  std::vector<int> tempMap;
10076  std::vector< std::vector<int> > tempMap2;
10077 
10078  int OriginalSize = jacMap.size();
10079 
10080  // If the columns of the jacstamp are not in ascending order then
10081  // jacStampMap will do bogus things. Our ADMS back-end doesn't guarantee
10082  // in-order jacStamps. So we reorder (through the maps)
10083  jacStampMap_fixOrder(jacStamp,jacMap2,tempStamp,tempMap2);
10084  jacStamp=tempStamp; jacMap2=tempMap2;
10085 
10086  if (collapseNode_GP)
10087  {
10088  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10090  tempStamp, tempMap, tempMap2,
10092  OriginalSize);
10093  // now move the new stuff into the old place
10094  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10095  numIntVars--;
10096  }
10097  if (collapseNode_SI)
10098  {
10099  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10101  tempStamp, tempMap, tempMap2,
10103  OriginalSize);
10104  // now move the new stuff into the old place
10105  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10106  numIntVars--;
10107  }
10108  if (collapseNode_DI)
10109  {
10110  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10112  tempStamp, tempMap, tempMap2,
10114  OriginalSize);
10115  // now move the new stuff into the old place
10116  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10117  numIntVars--;
10118  }
10119  if (collapseNode_BI)
10120  {
10121  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10123  tempStamp, tempMap, tempMap2,
10125  OriginalSize);
10126  // now move the new stuff into the old place
10127  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10128  numIntVars--;
10129  }
10130  if (collapseNode_BP)
10131  {
10132  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10134  tempStamp, tempMap, tempMap2,
10136  OriginalSize);
10137  // now move the new stuff into the old place
10138  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10139  numIntVars--;
10140  }
10141  if (collapseNode_BS)
10142  {
10143  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10145  tempStamp, tempMap, tempMap2,
10147  OriginalSize);
10148  // now move the new stuff into the old place
10149  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10150  numIntVars--;
10151  }
10152  if (collapseNode_BD)
10153  {
10154  tempStamp.clear(); tempMap.clear(); tempMap2.clear();
10156  tempStamp, tempMap, tempMap2,
10158  OriginalSize);
10159  // now move the new stuff into the old place
10160  jacStamp = tempStamp; jacMap = tempMap; jacMap2 = tempMap2;
10161  numIntVars--;
10162  }
10163 }
10164 
10165 //-----------------------------------------------------------------------------
10166 // Function : Instance::~Instance
10167 // Purpose : destructor
10168 // Special Notes :
10169 // Scope : public
10170 // Creator : admsXml
10171 // Creation Date :
10172 //-----------------------------------------------------------------------------
10174 {
10175 }
10176 
10177 //-----------------------------------------------------------------------------
10178 // Function : Instance::registerLIDs
10179 // Purpose : function for registering, and setting up, local ID's.
10180 // Special Notes :
10181 // Scope : public
10182 // Creator : admsXml
10183 // Creation Date :
10184 //-----------------------------------------------------------------------------
10185 void Instance::registerLIDs( const std::vector<int> & intLIDVecRef,
10186  const std::vector<int> & extLIDVecRef)
10187 {
10188  AssertLIDs(intLIDVecRef.size() == numIntVars);
10189  AssertLIDs(extLIDVecRef.size() == numExtVars);
10190 
10191 #ifdef Xyce_DEBUG_DEVICE
10192 
10193  if (getDeviceOptions().debugLevel > 0)
10194  {
10195  Xyce::dout() << std::endl << section_divider << std::endl;
10196  Xyce::dout() << "In ADMSPSP103VA::Instance::register LIDs\n\n";
10197  Xyce::dout() << "name = " << getName() << std::endl;
10198  Xyce::dout() << "number of internal variables: " << numIntVars << std::endl;
10199  Xyce::dout() << "number of external variables: " << numExtVars << std::endl;
10200  }
10201 #endif
10202 
10203  // copy over the global ID lists.
10204  intLIDVec = intLIDVecRef;
10205  extLIDVec = extLIDVecRef;
10206 
10207  // Now use these lists to obtain the indices into the linear algebra
10208  // entities. This assumes an order.
10209  int i=0;
10210  li_D = extLIDVecRef[i++];
10211  li_G = extLIDVecRef[i++];
10212  li_S = extLIDVecRef[i++];
10213  li_B = extLIDVecRef[i++];
10214 
10215 
10216  i=0;
10217  if (!collapseNode_GP)
10218  li_GP = intLIDVecRef[i++];
10219  else
10220  li_GP = li_G;
10221  if (!collapseNode_SI)
10222  li_SI = intLIDVecRef[i++];
10223  else
10224  li_SI = li_S;
10225  if (!collapseNode_DI)
10226  li_DI = intLIDVecRef[i++];
10227  else
10228  li_DI = li_D;
10229  if (!collapseNode_BI)
10230  li_BI = intLIDVecRef[i++];
10231  else
10232  li_BI = li_B;
10233  if (!collapseNode_BP)
10234  li_BP = intLIDVecRef[i++];
10235  else
10236  li_BP = li_BI;
10237  if (!collapseNode_BS)
10238  li_BS = intLIDVecRef[i++];
10239  else
10240  li_BS = li_BI;
10241  if (!collapseNode_BD)
10242  li_BD = intLIDVecRef[i++];
10243  else
10244  li_BD = li_BI;
10245 
10246 
10247 #ifdef Xyce_DEBUG_DEVICE
10248  if (getDeviceOptions().debugLevel > 0)
10249  {
10250  Xyce::dout() << "\nSolution and RHS variables:\n";
10251  Xyce::dout() << "\nli_D = " << li_D << std::endl;
10252  Xyce::dout() << "\nli_G = " << li_G << std::endl;
10253  Xyce::dout() << "\nli_S = " << li_S << std::endl;
10254  Xyce::dout() << "\nli_B = " << li_B << std::endl;
10255  Xyce::dout() << "\nli_GP = " << li_GP << std::endl;
10256  Xyce::dout() << "\nli_SI = " << li_SI << std::endl;
10257  Xyce::dout() << "\nli_DI = " << li_DI << std::endl;
10258  Xyce::dout() << "\nli_BI = " << li_BI << std::endl;
10259  Xyce::dout() << "\nli_BP = " << li_BP << std::endl;
10260  Xyce::dout() << "\nli_BS = " << li_BS << std::endl;
10261  Xyce::dout() << "\nli_BD = " << li_BD << std::endl;
10262  }
10263 #endif
10264 
10265 #ifdef Xyce_DEBUG_DEVICE
10266  if (getDeviceOptions().debugLevel > 0)
10267  {
10268  Xyce::dout() << "\nEnd of ADMSPSP103VA::Instance::register LIDs\n";
10269  Xyce::dout() << section_divider << std::endl;
10270  }
10271 #endif
10272 }
10273 
10274 //-----------------------------------------------------------------------------
10275 // Function : Instance::getIntNameMap
10276 // Purpose :
10277 // Special Notes :
10278 // Scope : public
10279 // Creator : admsXml
10280 // Creation Date :
10281 //-----------------------------------------------------------------------------
10282 std::map<int,std::string> & Instance::getIntNameMap ()
10283 {
10284 
10285  if (intNameMap.empty())
10286  {
10287  std::string tmpstr;
10288  if (!collapseNode_GP)
10289  {
10290 
10291  tmpstr = getName() + "_GP";
10292  spiceInternalName(tmpstr);
10293  intNameMap[li_GP] = tmpstr;
10294  }
10295  if (!collapseNode_SI)
10296  {
10297 
10298  tmpstr = getName() + "_SI";
10299  spiceInternalName(tmpstr);
10300  intNameMap[li_SI] = tmpstr;
10301  }
10302  if (!collapseNode_DI)
10303  {
10304 
10305  tmpstr = getName() + "_DI";
10306  spiceInternalName(tmpstr);
10307  intNameMap[li_DI] = tmpstr;
10308  }
10309  if (!collapseNode_BI)
10310  {
10311 
10312  tmpstr = getName() + "_BI";
10313  spiceInternalName(tmpstr);
10314  intNameMap[li_BI] = tmpstr;
10315  }
10316  if (!collapseNode_BP)
10317  {
10318 
10319  tmpstr = getName() + "_BP";
10320  spiceInternalName(tmpstr);
10321  intNameMap[li_BP] = tmpstr;
10322  }
10323  if (!collapseNode_BS)
10324  {
10325 
10326  tmpstr = getName() + "_BS";
10327  spiceInternalName(tmpstr);
10328  intNameMap[li_BS] = tmpstr;
10329  }
10330  if (!collapseNode_BD)
10331  {
10332 
10333  tmpstr = getName() + "_BD";
10334  spiceInternalName(tmpstr);
10335  intNameMap[li_BD] = tmpstr;
10336  }
10337 
10338  }
10339  return intNameMap;
10340 }
10341 
10342 //-----------------------------------------------------------------------------
10343 // Function : Instance::registerStateLIDs
10344 // Purpose :
10345 // Special Notes :
10346 // Scope : public
10347 // Creator : admsXml
10348 // Creation Date :
10349 //-----------------------------------------------------------------------------
10350 void Instance::registerStateLIDs( const std::vector<int> & staLIDVecRef)
10351 {
10352  AssertLIDs(staLIDVecRef.size() == numStateVars);
10353 }
10354 
10355 //-----------------------------------------------------------------------------
10356 // Function : Instance::jacobianStamp
10357 // Purpose :
10358 // Special Notes : In initial version, we won't support mapping away nodes
10359 // Scope : public
10360 // Creator : admsXml
10361 // Creation Date :
10362 //-----------------------------------------------------------------------------
10363 const std::vector< std::vector<int> > & Instance::jacobianStamp() const
10364 {
10365  return jacStamp;
10366 }
10367 
10368 //-----------------------------------------------------------------------------
10369 // Function : Instance::registerJacLIDs
10370 // Purpose : Create Offset variables used for referencing jacobian
10371 // elements
10372 // Special Notes :
10373 // Scope : public
10374 // Creator : admsXml
10375 // Creation Date :
10376 //-----------------------------------------------------------------------------
10377 void Instance::registerJacLIDs( const std::vector< std::vector<int> > & jacLIDVec)
10378 {
10380  std::vector<int> & map=jacMap;
10381  std::vector< std::vector<int> > & map2=jacMap2;
10382 
10383 
10384  // do nothing, we won't use the jac lids anymore, we'll use pointers
10385 
10386 }
10387 
10388 //-----------------------------------------------------------------------------
10389 // Function : Instance::setupPointers
10390 // Purpose : Create pointer variables used for referencing jacobian
10391 // elements
10392 // Special Notes :
10393 // Scope : public
10394 // Creator : admsXml
10395 // Creation Date :
10396 //-----------------------------------------------------------------------------
10398 {
10399 
10400  N_LAS_Matrix * dFdxMatPtr = extData.dFdxMatrixPtr;
10401  N_LAS_Matrix * dQdxMatPtr = extData.dQdxMatrixPtr;
10402  f_D_Equ_D_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_D,li_D);
10403  q_D_Equ_D_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_D,li_D);
10404  f_D_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_D,li_DI);
10405  q_D_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_D,li_DI);
10406  f_G_Equ_G_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_G,li_G);
10407  q_G_Equ_G_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_G,li_G);
10408  f_G_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_G,li_GP);
10409  q_G_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_G,li_GP);
10410  f_S_Equ_S_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_S,li_S);
10411  q_S_Equ_S_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_S,li_S);
10412  f_S_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_S,li_SI);
10413  q_S_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_S,li_SI);
10414  f_B_Equ_B_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_B,li_B);
10415  q_B_Equ_B_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_B,li_B);
10416  f_B_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_B,li_BI);
10417  q_B_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_B,li_BI);
10418  f_GP_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_SI);
10419  q_GP_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_SI);
10420  f_GP_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_BP);
10421  q_GP_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_BP);
10422  f_GP_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_DI);
10423  q_GP_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_DI);
10424  f_GP_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_GP);
10425  q_GP_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_GP);
10426  f_GP_Equ_G_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_GP,li_G);
10427  q_GP_Equ_G_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_GP,li_G);
10428  f_SI_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_SI);
10429  q_SI_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_SI);
10430  f_SI_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_BP);
10431  q_SI_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_BP);
10432  f_SI_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_GP);
10433  q_SI_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_GP);
10434  f_SI_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_DI);
10435  q_SI_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_DI);
10436  f_SI_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_BS);
10437  q_SI_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_BS);
10438  f_SI_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_BD);
10439  q_SI_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_BD);
10440  f_SI_Equ_S_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_SI,li_S);
10441  q_SI_Equ_S_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_SI,li_S);
10442  f_DI_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_SI);
10443  q_DI_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_SI);
10444  f_DI_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_BP);
10445  q_DI_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_BP);
10446  f_DI_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_GP);
10447  q_DI_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_GP);
10448  f_DI_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_DI);
10449  q_DI_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_DI);
10450  f_DI_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_BS);
10451  q_DI_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_BS);
10452  f_DI_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_BD);
10453  q_DI_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_BD);
10454  f_DI_Equ_D_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_DI,li_D);
10455  q_DI_Equ_D_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_DI,li_D);
10456  f_BI_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_BP);
10457  q_BI_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_BP);
10458  f_BI_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_BI);
10459  q_BI_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_BI);
10460  f_BI_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_BS);
10461  q_BI_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_BS);
10462  f_BI_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_BD);
10463  q_BI_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_BD);
10464  f_BI_Equ_B_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BI,li_B);
10465  q_BI_Equ_B_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BI,li_B);
10466  f_BP_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_SI);
10467  q_BP_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_SI);
10468  f_BP_Equ_BP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_BP);
10469  q_BP_Equ_BP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_BP);
10470  f_BP_Equ_GP_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_GP);
10471  q_BP_Equ_GP_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_GP);
10472  f_BP_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_DI);
10473  q_BP_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_DI);
10474  f_BP_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BP,li_BI);
10475  q_BP_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BP,li_BI);
10476  f_BS_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_SI);
10477  q_BS_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_SI);
10478  f_BS_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_BS);
10479  q_BS_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_BS);
10480  f_BS_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_DI);
10481  q_BS_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_DI);
10482  f_BS_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_BD);
10483  q_BS_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_BD);
10484  f_BS_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BS,li_BI);
10485  q_BS_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BS,li_BI);
10486  f_BD_Equ_SI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_SI);
10487  q_BD_Equ_SI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_SI);
10488  f_BD_Equ_BS_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_BS);
10489  q_BD_Equ_BS_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_BS);
10490  f_BD_Equ_DI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_DI);
10491  q_BD_Equ_DI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_DI);
10492  f_BD_Equ_BD_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_BD);
10493  q_BD_Equ_BD_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_BD);
10494  f_BD_Equ_BI_Node_Ptr = dFdxMatPtr->returnRawEntryPointer(li_BD,li_BI);
10495  q_BD_Equ_BI_Node_Ptr = dQdxMatPtr->returnRawEntryPointer(li_BD,li_BI);
10496 
10497 
10498 }
10499 
10500 // RHS load functions
10501 
10502 //-----------------------------------------------------------------------------
10503 // Function : Instance::loadDAEFVector
10504 // Purpose : load F vector (static contributions) for one instance for
10505 // NEW DAE formulation
10506 // Special Notes :
10507 // Scope : public
10508 // Creator : admsXml
10509 // Creation Date :
10510 //-----------------------------------------------------------------------------
10512 {
10513 
10514  bool bsuccess=true;
10515 
10527 
10528  return bsuccess;
10529 }
10530 
10531 //-----------------------------------------------------------------------------
10532 // Function : Instance::loadDAEQVector
10533 // Purpose : load Q vector (dynamic contributions) for one instance for
10534 // NEW DAE formulation
10535 // Special Notes :
10536 // Scope : public
10537 // Creator : admsXml
10538 // Creation Date :
10539 //-----------------------------------------------------------------------------
10541 {
10553 
10554  return true;
10555 }
10556 
10557 
10558 //-----------------------------------------------------------------------------
10559 // Function : Instance::updatePrimaryState
10560 // Purpose :
10561 // Special Notes : In this initial implementation, does little more than
10562 // call updateIntermediateVars()
10563 // Scope : public
10564 // Creator : admsXml
10565 // Creation Date :
10566 //-----------------------------------------------------------------------------
10568 {
10569  bool bsuccess = true;
10570 
10571  bsuccess = updateIntermediateVars();
10572 
10573  // if old DAE were implemented, we'd save dynamic contributions as state
10574  // here.
10575 
10576 
10577  return bsuccess;
10578 }
10579 
10580 //-----------------------------------------------------------------------------
10581 // Function : Instance::updateSecondaryState
10582 // Purpose :
10583 // Special Notes : In this initial implementation, does nothing
10584 // Scope : public
10585 // Creator : admsXml
10586 // Creation Date :
10587 //-----------------------------------------------------------------------------
10589 {
10590  bool bsuccess = true;
10591 
10592  // were old DAE implemented, we'd pull dynamic contribution derivatives
10593  // out of state.
10594 
10595  return bsuccess;
10596 }
10597 
10598 //-----------------------------------------------------------------------------
10599 // Function : Instance::updateIntermediateVars
10600 // Purpose : update intermediate variables for one PSP103VA instance
10601 // Special Notes :
10602 // Scope : public
10603 // Creator : admsXml
10604 // Creation Date :
10605 //-----------------------------------------------------------------------------
10607 {
10608 
10609  bool bsuccess=true;
10610  N_LAS_Vector * solVectorPtr = extData.nextSolVectorPtr;
10611 
10612 #ifdef Xyce_DEBUG_DEVICE
10613  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
10614  {
10615  Xyce::dout() << std::endl << subsection_divider << std::endl;
10616  Xyce::dout() << " In ADMSPSP103VA::Instance::updateIntermediateVars\n\n";
10617  Xyce::dout() << " name = " << getName() << std::endl;
10618  }
10619 #endif
10620 
10621  // Local variables
10622  AdmsFadType Qs;
10623  AdmsFadType Idse;
10624  AdmsFadType Igbe;
10625  AdmsFadType Igcse;
10626  AdmsFadType Igcde;
10627  AdmsFadType Igsove;
10628  AdmsFadType Igdove;
10629  AdmsFadType Igidle;
10630  AdmsFadType Igisle;
10631  AdmsFadType Iimpacte;
10632  double rgatenoise;
10633  double rsourcenoise;
10634  double rdrainnoise;
10635  double rbulknoise;
10636  double rjunsnoise;
10637  double rjundnoise;
10638  double rwellnoise;
10639  AdmsFadType vbbt;
10640  AdmsFadType two_psistar;
10641  AdmsFadType z;
10642  AdmsFadType vjlim;
10643  AdmsFadType tmp;
10644  AdmsFadType id;
10645  AdmsFadType wsrhstep;
10646  AdmsFadType dwsrh;
10647  AdmsFadType isrh;
10648  AdmsFadType btat;
10649  AdmsFadType twoatatoverthreebtat;
10650  AdmsFadType umaxbeforelimiting;
10651  AdmsFadType umax;
10652  AdmsFadType sqrtumax;
10653  AdmsFadType umaxpoweronepointfive;
10654  AdmsFadType wgamma;
10655  AdmsFadType wtat;
10656  AdmsFadType ktat;
10657  AdmsFadType ltat;
10658  AdmsFadType mtat;
10659  AdmsFadType xerfc;
10660  AdmsFadType ysq;
10661  AdmsFadType terfc;
10662  AdmsFadType erfcpos;
10663  AdmsFadType erfctimesexpmtat;
10664  AdmsFadType gammamax;
10665  AdmsFadType itat;
10666  AdmsFadType Fmaxr;
10667  AdmsFadType ibbt;
10668  AdmsFadType fbreakdown;
10669  AdmsFadType tm0;
10670  AdmsFadType tm1;
10671  AdmsFadType ijunfor1;
10672  AdmsFadType ijunfor2;
10673  AdmsFadType ijunrev;
10674  AdmsFadType h5;
10675  AdmsFadType h4;
10676  AdmsFadType h3;
10677  AdmsFadType h2d;
10678  double h2;
10679  double h1;
10680  AdmsFadType Gf_ac;
10681  AdmsFadType x_m_ac;
10682  AdmsFadType Gmob_dL_ac;
10683  AdmsFadType Gvsat_ac;
10684  AdmsFadType eta_p_ac;
10685  AdmsFadType H_ac;
10686  AdmsFadType GdL_ac;
10687  AdmsFadType qim1_ac;
10688  AdmsFadType qim_ac;
10689  AdmsFadType dps_ac;
10690  AdmsFadType alpha_ac;
10691  AdmsFadType Voxm_ac;
10692  AdmsFadType qeff1_ac;
10693  AdmsFadType xg_ac;
10694  AdmsFadType Vsbstar_ac;
10695  AdmsFadType Vgb;
10696  AdmsFadType COX_qm;
10697  AdmsFadType Fj;
10698  AdmsFadType Fj2;
10699  AdmsFadType QG;
10700  AdmsFadType QI;
10701  AdmsFadType QD;
10702  AdmsFadType QB;
10703  AdmsFadType Qg;
10704  AdmsFadType Qd;
10705  AdmsFadType Qb;
10706  AdmsFadType Qgs_ov;
10707  AdmsFadType Qgd_ov;
10708  AdmsFadType Qgb_ov;
10709  AdmsFadType Qfgs;
10710  AdmsFadType Qfgd;
10711  AdmsFadType QCLM;
10712  AdmsFadType xs_ov;
10713  AdmsFadType xd_ov;
10714  AdmsFadType Vovs;
10715  AdmsFadType Vovd;
10716  AdmsFadType Iimpact;
10717  AdmsFadType mavl;
10718  AdmsFadType Vrg;
10719  AdmsFadType Vrs;
10720  AdmsFadType Vrd;
10721  AdmsFadType Vrjuns;
10722  AdmsFadType Vrjund;
10723  AdmsFadType Vrbulk;
10724  AdmsFadType Vrwell;
10725  AdmsFadType Vgs;
10726  AdmsFadType Vds;
10727  AdmsFadType Vsb;
10728  AdmsFadType Vjun_s;
10729  AdmsFadType Vjun_d;
10730  AdmsFadType VgsPrime;
10731  AdmsFadType VsbPrime;
10732  AdmsFadType VdbPrime;
10733  AdmsFadType VgdPrime;
10734  AdmsFadType xgs_ov;
10735  AdmsFadType xgd_ov;
10736  double sigVds;
10737  AdmsFadType Vgd;
10738  AdmsFadType Vdb;
10739  AdmsFadType Vdsx;
10740  AdmsFadType Udse_dc;
10741  AdmsFadType Vdsat_dc;
10742  AdmsFadType Gf_dc;
10743  AdmsFadType x_m_dc;
10744  AdmsFadType x_ds_dc;
10745  AdmsFadType Gmob_dL_dc;
10746  AdmsFadType Gvsatinv_dc;
10747  AdmsFadType Gvsat_dc;
10748  AdmsFadType eta_p_dc;
10749  AdmsFadType H_dc;
10750  AdmsFadType FdL_dc;
10751  AdmsFadType GdL_dc;
10752  AdmsFadType qim1_dc;
10753  AdmsFadType qim_dc;
10754  AdmsFadType dps_dc;
10755  AdmsFadType alpha_dc;
10756  AdmsFadType Voxm_dc;
10757  AdmsFadType qeff1_dc;
10758  AdmsFadType xg_dc;
10759  AdmsFadType help;
10760  AdmsFadType temp1;
10761  AdmsFadType temp2;
10762  AdmsFadType mutau;
10763  AdmsFadType nu;
10764  AdmsFadType delVg;
10765  AdmsFadType Vgb1;
10766  AdmsFadType Vgbstar;
10767  AdmsFadType Vdbstar;
10768  AdmsFadType Vsbnud;
10769  AdmsFadType Vmbnew;
10770  AdmsFadType usnew;
10771  AdmsFadType us;
10772  AdmsFadType Vmb;
10773  AdmsFadType Vsbstar_dc;
10774  AdmsFadType temp;
10775  AdmsFadType delVsat;
10776  AdmsFadType Ids;
10777  double GOV;
10778  double GOV2;
10779  double xi_ov;
10780  double inv_xi_ov;
10781  double x_mrg_ov;
10782  double inv_xg1;
10783  double SP_OV_Afac;
10784  AdmsFadType SP_OV_xbar;
10785  AdmsFadType SP_OV_x0;
10786  AdmsFadType SP_OV_u;
10787  AdmsFadType SP_OV_yg;
10788  AdmsFadType SP_OV_z;
10789  AdmsFadType SP_OV_eta;
10790  AdmsFadType SP_OV_a;
10791  AdmsFadType SP_OV_c;
10792  AdmsFadType SP_OV_tau;
10793  AdmsFadType SP_OV_y0;
10794  AdmsFadType SP_OV_D0;
10795  AdmsFadType SP_OV_temp;
10796  AdmsFadType SP_OV_p;
10797  AdmsFadType SP_OV_q;
10798  AdmsFadType SP_OV_xi;
10799  AdmsFadType SP_OV_w;
10800  AdmsFadType Igsov;
10801  AdmsFadType Igdov;
10802  AdmsFadType Igc;
10803  AdmsFadType Igb;
10804  AdmsFadType Igcs;
10805  AdmsFadType Igcd;
10806  AdmsFadType arg2mina;
10807  AdmsFadType psi_t;
10808  AdmsFadType zg;
10809  AdmsFadType arg1;
10810  AdmsFadType Dsi;
10811  AdmsFadType Dgate;
10812  AdmsFadType TP;
10813  AdmsFadType Vm;
10814  AdmsFadType Igc0;
10815  AdmsFadType u0;
10816  AdmsFadType x;
10817  AdmsFadType u0_div_H;
10818  AdmsFadType Bg;
10819  AdmsFadType Ag;
10820  AdmsFadType inv_x;
10821  AdmsFadType ex;
10822  AdmsFadType inv_ex;
10823  AdmsFadType xsq;
10824  AdmsFadType igc;
10825  AdmsFadType igcd_h;
10826  AdmsFadType Sg;
10827  AdmsFadType Igidl;
10828  AdmsFadType Igisl;
10829  AdmsFadType Vtovd;
10830  AdmsFadType Vtovs;
10831 
10832 
10833  // set the sizes of the Fad arrays:
10834 
10835  if (probeVars.size() != (12))
10836  {
10837  probeVars.resize(12);
10838  staticContributions.resize(11+0);
10839  dynamicContributions.resize(11+0);
10840  }
10841 
10842  // initialize contributions to zero (automatically sets derivatives to zero)
10843  for (int i=0; i < 11+0 ; ++i)
10844  {
10845  staticContributions[i]=0;
10846  dynamicContributions[i]=0;
10847  }
10848 
10849  // extract solution variables and set as Fad independent variables.
10850  probeVars[admsProbeID_V_DI_BD] = (*solVectorPtr)[li_DI] - (*solVectorPtr)[li_BD];
10852 
10853  probeVars[admsProbeID_V_SI_BS] = (*solVectorPtr)[li_SI] - (*solVectorPtr)[li_BS];
10855 
10856  probeVars[admsProbeID_V_SI_BP] = (*solVectorPtr)[li_SI] - (*solVectorPtr)[li_BP];
10858 
10859  probeVars[admsProbeID_V_DI_SI] = (*solVectorPtr)[li_DI] - (*solVectorPtr)[li_SI];
10861 
10862  probeVars[admsProbeID_V_GP_SI] = (*solVectorPtr)[li_GP] - (*solVectorPtr)[li_SI];
10864 
10865  probeVars[admsProbeID_V_B_BI] = (*solVectorPtr)[li_B] - (*solVectorPtr)[li_BI];
10867 
10868  probeVars[admsProbeID_V_BP_BI] = (*solVectorPtr)[li_BP] - (*solVectorPtr)[li_BI];
10870 
10871  probeVars[admsProbeID_V_BD_BI] = (*solVectorPtr)[li_BD] - (*solVectorPtr)[li_BI];
10873 
10874  probeVars[admsProbeID_V_BS_BI] = (*solVectorPtr)[li_BS] - (*solVectorPtr)[li_BI];
10876 
10877  probeVars[admsProbeID_V_D_DI] = (*solVectorPtr)[li_D] - (*solVectorPtr)[li_DI];
10879 
10880  probeVars[admsProbeID_V_S_SI] = (*solVectorPtr)[li_S] - (*solVectorPtr)[li_SI];
10882 
10883  probeVars[admsProbeID_V_G_GP] = (*solVectorPtr)[li_G] - (*solVectorPtr)[li_GP];
10885 
10886 
10887  // -- code converted from analog/code block
10888  //Begin block evaluateStatic
10889  {
10890  QCLM = 0.0;
10891  xs_ov = 0.0;
10892  xd_ov = 0.0;
10893  Vovs = 0.0;
10894  Vovd = 0.0;
10895  Iimpact = 0.0;
10896  mavl = 0.0;
10897  Vrg = (probeVars[admsProbeID_V_G_GP]);
10898  Vrs = (probeVars[admsProbeID_V_S_SI]);
10899  Vrd = (probeVars[admsProbeID_V_D_DI]);
10900  Vrjuns = (probeVars[admsProbeID_V_BS_BI]);
10901  Vrjund = (probeVars[admsProbeID_V_BD_BI]);
10902  Vrbulk = (probeVars[admsProbeID_V_BP_BI]);
10903  Vrwell = (probeVars[admsProbeID_V_B_BI]);
10904  if (((model_.CHNL_TYPE)==(+1)))
10905  {
10906  Vgs = (probeVars[admsProbeID_V_GP_SI]);
10907  Vds = (probeVars[admsProbeID_V_DI_SI]);
10908  Vsb = (probeVars[admsProbeID_V_SI_BP]);
10909  Vjun_s = (-(probeVars[admsProbeID_V_SI_BS]));
10910  Vjun_d = (-(probeVars[admsProbeID_V_DI_BD]));
10911  }
10912  else
10913  {
10914  Vgs = (-(probeVars[admsProbeID_V_GP_SI]));
10915  Vds = (-(probeVars[admsProbeID_V_DI_SI]));
10916  Vsb = (-(probeVars[admsProbeID_V_SI_BP]));
10917  Vjun_s = (probeVars[admsProbeID_V_SI_BS]);
10918  Vjun_d = (probeVars[admsProbeID_V_DI_BD]);
10919  }
10920  VgsPrime = Vgs;
10921  VsbPrime = Vsb;
10922  VdbPrime = (Vds+Vsb);
10923  VgdPrime = (Vgs-Vds);
10924  xgs_ov = ((-VgsPrime)*(model_.inv_phit));
10925  xgd_ov = ((-VgdPrime)*(model_.inv_phit));
10926  sigVds = 1.0;
10927  if ((Vds<0.0))
10928  {
10929  sigVds = (-1.0);
10930  Vgs = (Vgs-Vds);
10931  Vsb = (Vsb+Vds);
10932  Vds = (-Vds);
10933  }
10934  Vgd = (Vgs-Vds);
10935  Vdb = (Vds+Vsb);
10936  Vdsx = (sqrt(((Vds*Vds)+0.01))-0.1);
10937  //Begin block SPcalc_dc
10938  {
10939  //Block-local variables for block SPcalc_dc
10940  double phib;
10941  double G_0;
10942  double sqrt_phib;
10943  AdmsFadType Vsbstar;
10944  AdmsFadType Vsbx;
10945  //End of Block-local variables
10946  //Block-local variables for block SPcalc_dc
10947  AdmsFadType xg;
10948  AdmsFadType qeff;
10949  AdmsFadType qeff1;
10950  AdmsFadType Voxm;
10951  AdmsFadType alpha;
10952  AdmsFadType dps;
10953  AdmsFadType qim;
10954  AdmsFadType qim1;
10955  AdmsFadType GdL;
10956  AdmsFadType H;
10957  AdmsFadType eta_p;
10958  AdmsFadType s1;
10959  //End of Block-local variables
10960  //Block-local variables for block SPcalc_dc
10961  AdmsFadType Gvsat;
10962  AdmsFadType Gvsatinv;
10963  AdmsFadType Gmob_dL;
10964  AdmsFadType x_ds;
10965  AdmsFadType x_m;
10966  //End of Block-local variables
10967  //Block-local variables for block SPcalc_dc
10968  AdmsFadType Dnsub;
10969  //End of Block-local variables
10970  //Block-local variables for block SPcalc_dc
10971  AdmsFadType x_s;
10972  AdmsFadType sqm;
10973  AdmsFadType alpha1;
10974  AdmsFadType phi_inf;
10975  AdmsFadType za;
10976  AdmsFadType xitsb;
10977  AdmsFadType rhob;
10978  //End of Block-local variables
10979  //Block-local variables for block SPcalc_dc
10980  AdmsFadType thesat1;
10981  AdmsFadType wsat;
10982  AdmsFadType ysat;
10983  AdmsFadType zsat;
10984  AdmsFadType dL;
10985  AdmsFadType GR;
10986  AdmsFadType Gmob;
10987  //End of Block-local variables
10988  //Block-local variables for block SPcalc_dc
10989  AdmsFadType xgm;
10990  AdmsFadType Ux;
10991  //End of Block-local variables
10992  //Block-local variables for block SPcalc_dc
10993  AdmsFadType xn_s;
10994  AdmsFadType delta_ns;
10995  //End of Block-local variables
10996  //Block-local variables for block SPcalc_dc
10997  AdmsFadType Gf;
10998  AdmsFadType Gf2;
10999  AdmsFadType inv_Gf2;
11000  AdmsFadType xi;
11001  AdmsFadType inv_xi;
11002  AdmsFadType margin;
11003  //End of Block-local variables
11004  //Block-local variables for block SPcalc_dc
11005  AdmsFadType SP_xg1;
11006  AdmsFadType SP_S_temp;
11007  AdmsFadType SP_S_temp1;
11008  AdmsFadType SP_S_temp2;
11009  //End of Block-local variables
11010  //Block-local variables for block SPcalc_dc
11011  AdmsFadType SP_S_yg;
11012  AdmsFadType SP_S_ysub;
11013  AdmsFadType SP_S_y0;
11014  AdmsFadType SP_S_a;
11015  AdmsFadType SP_S_b;
11016  AdmsFadType SP_S_c;
11017  //End of Block-local variables
11018  //Block-local variables for block SPcalc_dc
11019  AdmsFadType SP_S_bx;
11020  AdmsFadType SP_S_tau;
11021  AdmsFadType SP_S_eta;
11022  AdmsFadType SP_S_delta0;
11023  AdmsFadType SP_S_delta1;
11024  //End of Block-local variables
11025  //Block-local variables for block SPcalc_dc
11026  AdmsFadType SP_S_pC;
11027  AdmsFadType SP_S_qC;
11028  AdmsFadType SP_S_A_fac;
11029  //End of Block-local variables
11030  //Block-local variables for block SPcalc_dc
11031  AdmsFadType SP_S_x1;
11032  AdmsFadType SP_S_w;
11033  AdmsFadType SP_S_xbar;
11034  AdmsFadType SP_S_x0;
11035  //End of Block-local variables
11036  //Block-local variables for block SPcalc_dc
11037  AdmsFadType SP_S_xi0;
11038  AdmsFadType SP_S_xi1;
11039  AdmsFadType SP_S_xi2;
11040  //End of Block-local variables
11041  //Block-local variables for block SPcalc_dc
11042  AdmsFadType x_d;
11043  AdmsFadType Rxcor;
11044  AdmsFadType delta_1s;
11045  AdmsFadType xi0s;
11046  AdmsFadType xi1s;
11047  AdmsFadType xi2s;
11048  AdmsFadType xi0d;
11049  //End of Block-local variables
11050  //Block-local variables for block SPcalc_dc
11051  AdmsFadType Es;
11052  AdmsFadType Em;
11053  AdmsFadType Ed;
11054  AdmsFadType Ds;
11055  AdmsFadType Dm;
11056  AdmsFadType Dd;
11057  AdmsFadType Ps;
11058  AdmsFadType xgs;
11059  AdmsFadType qis;
11060  AdmsFadType qbs;
11061  AdmsFadType qbm;
11062  AdmsFadType Eeffm;
11063  //End of Block-local variables
11064  //Block-local variables for block SPcalc_dc
11065  AdmsFadType Phi_0;
11066  AdmsFadType Phi_2;
11067  AdmsFadType asat;
11068  AdmsFadType Phi_0_2;
11069  AdmsFadType Phi0_Phi2;
11070  //End of Block-local variables
11071  //Block-local variables for block SPcalc_dc
11072  AdmsFadType Vdse;
11073  AdmsFadType Vdsat;
11074  AdmsFadType Udse;
11075  AdmsFadType xn_d;
11076  AdmsFadType k_ds;
11077  //End of Block-local variables
11078  //Block-local variables for block SPcalc_dc
11079  AdmsFadType Mutmp;
11080  AdmsFadType Phi_sat;
11081  AdmsFadType delta_nd;
11082  //End of Block-local variables
11083  //Block-local variables for block SPcalc_dc
11084  AdmsFadType pC;
11085  AdmsFadType qC;
11086  AdmsFadType Pm;
11087  //End of Block-local variables
11088  //Block-local variables for block SPcalc_dc
11089  AdmsFadType d0;
11090  AdmsFadType D_bar;
11091  AdmsFadType km;
11092  AdmsFadType x_pm;
11093  AdmsFadType xi_pd;
11094  AdmsFadType p_pd;
11095  AdmsFadType u_pd;
11096  AdmsFadType q_pd;
11097  //End of Block-local variables
11098  //Block-local variables for block SPcalc_dc
11099  AdmsFadType FdL;
11100  AdmsFadType qim1_1;
11101  AdmsFadType r1;
11102  AdmsFadType r2;
11103  AdmsFadType s2;
11104  AdmsFadType dL1;
11105  //End of Block-local variables
11106  temp = ((0.5*((Vdb+Vsb)-sqrt((((Vdb-Vsb)*(Vdb-Vsb))+bphi_dc))))+phix_dc);
11107  Vsbstar_dc = ((Vsb-(0.5*((temp)-sqrt((((temp)*(temp))+aphi_dc)))))+phix1_dc);
11108  if ((((model_.SWNUD_i)!=0)&&(GFACNUD_i!=1.0)))
11109  {
11110  Vmb = (Vsbstar_dc+(0.5*(Vds-Vdsx)));
11111  us = (sqrt((Vmb+phib_dc))-sqrt_phib_dc);
11112  temp = (((2*(us-us1))/us21)-1);
11113  usnew = (us-(((0.25*(1-GFACNUD_i))*us21)*(temp+sqrt(((temp*temp)+0.4804530139182)))));
11114  Vmbnew = ((usnew*usnew)+((2*sqrt_phib_dc)*usnew));
11115  Vsbnud = (Vmbnew-(0.5*(Vds-Vdsx)));
11116  }
11117  else
11118  {
11119  Vsbnud = Vsbstar_dc;
11120  }
11121  phib = phib_dc;
11122  G_0 = G_0_dc;
11123  sqrt_phib = sqrt_phib_dc;
11124  Vsbstar = Vsbnud;
11125  FdL = 1.0;
11126  alpha = 0.0;
11127  GdL = 1.0;
11128  dL = 0.0;
11129  qbm = 0.0;
11130  dps = 0.0;
11131  qim = 0.0;
11132  qim1 = 0.0;
11133  H = 1.0;
11134  eta_p = 1.0;
11135  Gvsat = 1.0;
11136  Gvsatinv = 1.0;
11137  SP_S_x1 = 0.0;
11138  x_s = 0.0;
11139  sqm = 0.0;
11140  xitsb = 0.0;
11141  rhob = 0.0;
11142  Gmob = 1.0;
11143  Gmob_dL = 1.0;
11144  Udse = 0.0;
11145  thesat1 = 0.0;
11146  xgm = 0.0;
11147  Vdbstar = (Vds+Vsbstar);
11148  Vgbstar = (Vgs+Vsbstar);
11149  Vgb1 = (Vgbstar-VFB_i);
11150  Vsbx = (Vsbstar+(0.5*(Vds-Vdsx)));
11151  delVg = (CF_i*(Vdsx*(1+(CFB_i*Vsbx))));
11152  Vgb1 = (Vgb1+delVg);
11153  xg = (Vgb1*inv_phit1);
11154  if ((DNSUB_i>0.0))
11155  {
11156  Dnsub = ((DNSUB_i*0.5)*((+((Vgs+Vsb)-VNSUB_i))+sqrt((((-((Vgs+Vsb)-VNSUB_i))*(-((Vgs+Vsb)-VNSUB_i)))+NSLP_i))));
11157  Gf = (G_0*sqrt((1.0+Dnsub)));
11158  }
11159  else
11160  {
11161  Gf = G_0;
11162  }
11163  Gf2 = (Gf*Gf);
11164  inv_Gf2 = (1.0/Gf2);
11165  xi = (1.0+(Gf*7.0710678118654746e-01));
11166  inv_xi = (1.0/xi);
11167  Ux = (Vsbstar*inv_phit1);
11168  xn_s = ((phib*inv_phit1)+Ux);
11169  if ((xn_s<4.6051701859880916e+02))
11170  {
11171  delta_ns = exp((-xn_s));
11172  }
11173  else
11174  {
11175  delta_ns = (1.0e-200/(1.0+((xn_s-4.6051701859880916e+02)*(1.0+(0.5*((xn_s-4.6051701859880916e+02)*(1.0+((xn_s-4.6051701859880916e+02)*3.3333333333333333e-01))))))));
11176  }
11177  margin = (1e-5*xi);
11178  if ((fabs(xg)<=margin))
11179  {
11180  SP_S_temp1 = (((inv_xi*inv_xi)*1.6666666666666667e-01)*7.0710678118654746e-01);
11181  x_s = ((xg*inv_xi)*(1.0+(((xg*(1.0-delta_ns))*Gf)*SP_S_temp1)));
11182  }
11183  else
11184  {
11185  if ((xg<(-margin)))
11186  {
11187  SP_S_yg = (-xg);
11188  SP_S_ysub = (1.25*(SP_S_yg*inv_xi));
11189  SP_S_eta = (0.5*((SP_S_ysub+10)-sqrt((((SP_S_ysub-6.0)*(SP_S_ysub-6.0))+64.0))));
11190  SP_S_temp = (SP_S_yg-SP_S_eta);
11191  SP_S_a = ((SP_S_temp*SP_S_temp)+(Gf2*(SP_S_eta+1.0)));
11192  SP_S_c = ((2.0*SP_S_temp)-Gf2);
11193  SP_S_tau = ((-SP_S_eta)+log((SP_S_a*inv_Gf2)));
11194  nu = (SP_S_a+SP_S_c);
11195  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-SP_S_a)));
11196  SP_S_y0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-SP_S_a)))));
11197  if ((SP_S_y0<2.3025850929940458e+02))
11198  {
11199  SP_S_delta0 = exp(SP_S_y0);
11200  }
11201  else
11202  {
11203  SP_S_delta0 = (1.0e100*(1.0+((SP_S_y0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_y0-2.3025850929940458e+02)*(1.0+((SP_S_y0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11204  }
11205  SP_S_delta1 = (1.0/SP_S_delta0);
11206  SP_S_temp = (1.0/(2.0+(SP_S_y0*SP_S_y0)));
11207  SP_S_xi0 = ((SP_S_y0*SP_S_y0)*SP_S_temp);
11208  SP_S_xi1 = (4.0*((SP_S_y0*SP_S_temp)*SP_S_temp));
11209  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
11210  SP_S_temp = (SP_S_yg-SP_S_y0);
11211  SP_S_temp1 = (delta_ns*SP_S_delta1);
11212  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((SP_S_delta0-1.0)-SP_S_temp1)+(delta_ns*(1.0-SP_S_xi1)))));
11213  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta0-SP_S_y0)-1.0)+SP_S_temp1)+(delta_ns*((SP_S_y0-1.0)-SP_S_xi0)))));
11214  SP_S_temp = (2.0-(Gf2*((SP_S_delta0+SP_S_temp1)-(delta_ns*SP_S_xi2))));
11215  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
11216  x_s = ((-SP_S_y0)-(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
11217  }
11218  else
11219  {
11220  SP_xg1 = (1.0/(x1+(Gf*7.324648775608221e-001)));
11221  SP_S_A_fac = ((((xi*x1)*SP_xg1)-1.0)*SP_xg1);
11222  SP_S_xbar = ((xg*inv_xi)*(1.0+(SP_S_A_fac*xg)));
11223  if (((-SP_S_xbar)>(-2.3025850929940458e+02)))
11224  {
11225  SP_S_temp = exp((-SP_S_xbar));
11226  }
11227  else
11228  {
11229  SP_S_temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_S_xbar))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_S_xbar))*(1.0+(((-2.3025850929940458e+02)-(-SP_S_xbar))*3.3333333333333333e-01))))))));
11230  }
11231  SP_S_w = (1.0-SP_S_temp);
11232  SP_S_x1 = ((xg+(Gf2*0.5))-(Gf*sqrt(((xg+(Gf2*0.25))-SP_S_w))));
11233  SP_S_bx = (xn_s+3.0);
11234  SP_S_eta = ((0.5*((SP_S_x1+SP_S_bx)-sqrt((((SP_S_x1-SP_S_bx)*(SP_S_x1-SP_S_bx))+5.0))))-(0.5*(SP_S_bx-sqrt(((SP_S_bx*SP_S_bx)+5.0)))));
11235  SP_S_temp = (xg-SP_S_eta);
11236  SP_S_temp1 = exp((-SP_S_eta));
11237  SP_S_temp2 = (1.0/(2.0+(SP_S_eta*SP_S_eta)));
11238  SP_S_xi0 = ((SP_S_eta*SP_S_eta)*SP_S_temp2);
11239  SP_S_xi1 = (4.0*((SP_S_eta*SP_S_temp2)*SP_S_temp2));
11240  SP_S_xi2 = ((((8.0*SP_S_temp2)-(12.0*SP_S_xi0))*SP_S_temp2)*SP_S_temp2);
11241  SP_S_a = max(1.0e-40,((SP_S_temp*SP_S_temp)-(Gf2*(((SP_S_temp1+SP_S_eta)-1.0)-(delta_ns*((SP_S_eta+1.0)+SP_S_xi0))))));
11242  SP_S_b = (1.0-(0.5*(Gf2*(SP_S_temp1-(delta_ns*SP_S_xi2)))));
11243  SP_S_c = ((2.0*SP_S_temp)+(Gf2*((1.0-SP_S_temp1)-(delta_ns*(1.0+SP_S_xi1)))));
11244  SP_S_tau = ((xn_s-SP_S_eta)+log((SP_S_a/Gf2)));
11245  nu = (SP_S_a+SP_S_c);
11246  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-(SP_S_a*SP_S_b))));
11247  SP_S_x0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-(SP_S_a*SP_S_b))))));
11248  if ((SP_S_x0<2.3025850929940458e+02))
11249  {
11250  SP_S_delta0 = exp(SP_S_x0);
11251  SP_S_delta1 = (1.0/SP_S_delta0);
11252  SP_S_delta0 = (delta_ns*SP_S_delta0);
11253  }
11254  else
11255  {
11256  if ((SP_S_x0>(xn_s-2.3025850929940458e+02)))
11257  {
11258  SP_S_delta0 = exp((SP_S_x0-xn_s));
11259  SP_S_delta1 = (delta_ns/SP_S_delta0);
11260  }
11261  else
11262  {
11263  SP_S_delta0 = (1.0e-100/(1.0+(((xn_s-SP_S_x0)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_s-SP_S_x0)-2.3025850929940458e+02)*(1.0+(((xn_s-SP_S_x0)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11264  SP_S_delta1 = (1.0e-100/(1.0+((SP_S_x0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_x0-2.3025850929940458e+02)*(1.0+((SP_S_x0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11265  }
11266  }
11267  SP_S_temp = (1.0/(2.0+(SP_S_x0*SP_S_x0)));
11268  SP_S_xi0 = ((SP_S_x0*SP_S_x0)*SP_S_temp);
11269  SP_S_xi1 = (4.0*((SP_S_x0*SP_S_temp)*SP_S_temp));
11270  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
11271  SP_S_temp = (xg-SP_S_x0);
11272  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((1.0-SP_S_delta1)+SP_S_delta0)-(delta_ns*(1.0+SP_S_xi1)))));
11273  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta1+SP_S_x0)-1.0)+SP_S_delta0)-(delta_ns*((SP_S_x0+1.0)+SP_S_xi0)))));
11274  SP_S_temp = (2.0-(Gf2*((SP_S_delta1+SP_S_delta0)-(delta_ns*SP_S_xi2))));
11275  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
11276  x_s = (SP_S_x0+(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
11277  }
11278  }
11279  x_d = x_s;
11280  x_m = x_s;
11281  x_ds = 0.0;
11282  if ((xg<=0.0))
11283  {
11284  qis = 0.0;
11285  xgm = (xg-x_s);
11286  Voxm = (xgm*phit1);
11287  qeff1 = Voxm;
11288  Vdsat = Vdsat_lim;
11289  }
11290  else
11291  {
11292  delta_1s = 0.0;
11293  temp = (1.0/(2.0+(x_s*x_s)));
11294  xi0s = ((x_s*x_s)*temp);
11295  xi1s = (4.0*((x_s*temp)*temp));
11296  xi2s = ((((8.0*temp)-(12.0*xi0s))*temp)*temp);
11297  if ((x_s<2.3025850929940458e+02))
11298  {
11299  delta_1s = exp(x_s);
11300  Es = (1.0/delta_1s);
11301  delta_1s = (delta_ns*delta_1s);
11302  }
11303  else
11304  {
11305  if ((x_s>(xn_s-2.3025850929940458e+02)))
11306  {
11307  delta_1s = exp((x_s-xn_s));
11308  Es = (delta_ns/delta_1s);
11309  }
11310  else
11311  {
11312  delta_1s = (1.0e-100/(1.0+(((xn_s-x_s)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_s-x_s)-2.3025850929940458e+02)*(1.0+(((xn_s-x_s)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11313  Es = (1.0e-100/(1.0+((x_s-2.3025850929940458e+02)*(1.0+(0.5*((x_s-2.3025850929940458e+02)*(1.0+((x_s-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11314  }
11315  }
11316  Ds = (delta_1s-(delta_ns*((x_s+1.0)+xi0s)));
11317  if ((x_s<1.0e-5))
11318  {
11319  Ps = (0.5*((x_s*x_s)*(1.0-(3.3333333333333333e-01*(x_s*(1.0-(0.25*x_s)))))));
11320  Ds = (1.6666666666666667e-01*((((delta_ns*x_s)*x_s)*x_s)*(1.0+(1.75*x_s))));
11321  temp = sqrt((1.0-(3.3333333333333333e-01*(x_s*(1.0-(0.25*x_s))))));
11322  sqm = (7.0710678118654746e-01*(x_s*temp));
11323  alpha = (1.0+(((Gf*7.0710678118654746e-01)*((1.0-(0.5*x_s))+(1.6666666666666667e-01*(x_s*x_s))))/temp));
11324  }
11325  else
11326  {
11327  Ps = ((x_s-1.0)+Es);
11328  sqm = sqrt(Ps);
11329  alpha = (1.0+(0.5*((Gf*(1.0-Es))/sqm)));
11330  }
11331  Em = Es;
11332  Ed = Em;
11333  Dm = Ds;
11334  Dd = Dm;
11335  Rxcor = ((1.0+((0.2*XCOR_i)*Vsbx))/(1.0+(XCOR_i*Vsbx)));
11336  if ((Ds>1.0e-100))
11337  {
11338  xgs = (Gf*sqrt((Ps+Ds)));
11339  qis = (((Gf2*Ds)*phit1)/(xgs+(Gf*sqm)));
11340  qbs = ((sqm*Gf)*phit1);
11341  if ((RSB_i<0))
11342  {
11343  rhob = (1.0/(1.0-(RSB_i*Vsbx)));
11344  }
11345  else
11346  {
11347  rhob = (1.0+(RSB_i*Vsbx));
11348  }
11349  if ((RSG_i<0))
11350  {
11351  temp = (1.0-(RSG_i*qis));
11352  }
11353  else
11354  {
11355  temp = (1.0/(1.0+(RSG_i*qis)));
11356  }
11357  GR = (THER_i*((rhob*temp)*qis));
11358  Eeffm = (E_eff0*(qbs+(eta_mu*qis)));
11359  if (((Eeffm*MUE_i)!=0))
11360  {
11361  Mutmp = (pow((Eeffm*MUE_i),THEMU_i)+(CS_i*(Ps/((Ps+Ds)+1.0e-14))));
11362  }
11363  else
11364  {
11365  Mutmp = (CS_i*(Ps/((Ps+Ds)+1.0e-14)));
11366  }
11367  Gmob = (((1.0+Mutmp)+GR)*Rxcor);
11368  if ((THESATB_i<0))
11369  {
11370  xitsb = (1.0/(1.0-(THESATB_i*Vsbx)));
11371  }
11372  else
11373  {
11374  xitsb = (1.0+(THESATB_i*Vsbx));
11375  }
11376  temp2 = (qis*xitsb);
11377  wsat = (100.0*(temp2/(100.0+temp2)));
11378  if ((THESATG_i<0))
11379  {
11380  temp = (1/(1-(THESATG_i*wsat)));
11381  }
11382  else
11383  {
11384  temp = (1+(THESATG_i*wsat));
11385  }
11386  thesat1 = (THESAT_i*(temp/Gmob));
11387  phi_inf = ((qis/alpha)+phit1);
11388  ysat = ((thesat1*phi_inf)*7.0710678118654746e-01);
11389  if (((model_.CHNL_TYPE)==(-1)))
11390  {
11391  ysat = (ysat/sqrt((1.0+ysat)));
11392  }
11393  za = (2.0/(1.0+sqrt((1.0+(4.0*ysat)))));
11394  temp1 = (za*ysat);
11395  Phi_0 = ((phi_inf*za)*(1.0+(0.86*((temp1*(1.0-(temp1*za)))/(1.0+(4.0*((temp1*temp1)*za)))))));
11396  asat = (xgs+(0.5*Gf2));
11397  Phi_2 = (0.98*(((Gf2*Ds)*phit1)/(asat+sqrt(((asat*asat)-((Gf2*Ds)*0.98))))));
11398  Phi_0_2 = (Phi_0+Phi_2);
11399  Phi0_Phi2 = (2.0*(Phi_0*Phi_2));
11400  Phi_sat = (Phi0_Phi2/(Phi_0_2+sqrt(((Phi_0_2*Phi_0_2)-(1.98*Phi0_Phi2)))));
11401  Vdsat = (Phi_sat-(phit1*log((1.0+(((Phi_sat*(Phi_sat-((2.0*asat)*phit1)))*inv_Gf2)/((phit1*phit1)*Ds))))));
11402  }
11403  else
11404  {
11405  Vdsat = Vdsat_lim;
11406  }
11407  if (((Vds/Vdsat)!=0))
11408  {
11409  temp = pow((Vds/Vdsat),AX_i);
11410  }
11411  else
11412  {
11413  temp = 0;
11414  }
11415  Vdse = (Vds*pow((1.0+temp),(-inv_AX)));
11416  Udse = (Vdse*inv_phit1);
11417  xn_d = (xn_s+Udse);
11418  if ((Udse<4.6051701859880916e+02))
11419  {
11420  k_ds = exp((-Udse));
11421  }
11422  else
11423  {
11424  k_ds = (1.0e-200/(1.0+((Udse-4.6051701859880916e+02)*(1.0+(0.5*((Udse-4.6051701859880916e+02)*(1.0+((Udse-4.6051701859880916e+02)*3.3333333333333333e-01))))))));
11425  }
11426  delta_nd = (delta_ns*k_ds);
11427  if ((fabs(xg)<=margin))
11428  {
11429  SP_S_temp1 = (((inv_xi*inv_xi)*1.6666666666666667e-01)*7.0710678118654746e-01);
11430  x_d = ((xg*inv_xi)*(1.0+(((xg*(1.0-delta_nd))*Gf)*SP_S_temp1)));
11431  }
11432  else
11433  {
11434  SP_S_bx = (xn_d+3);
11435  SP_S_eta = ((0.5*((SP_S_x1+SP_S_bx)-sqrt((((SP_S_x1-SP_S_bx)*(SP_S_x1-SP_S_bx))+5.0))))-(0.5*(SP_S_bx-sqrt(((SP_S_bx*SP_S_bx)+5.0)))));
11436  SP_S_temp = (xg-SP_S_eta);
11437  SP_S_temp1 = exp((-SP_S_eta));
11438  SP_S_temp2 = (1.0/(2.0+(SP_S_eta*SP_S_eta)));
11439  SP_S_xi0 = ((SP_S_eta*SP_S_eta)*SP_S_temp2);
11440  SP_S_xi1 = (4.0*((SP_S_eta*SP_S_temp2)*SP_S_temp2));
11441  SP_S_xi2 = ((((8.0*SP_S_temp2)-(12.0*SP_S_xi0))*SP_S_temp2)*SP_S_temp2);
11442  SP_S_a = max(1.0e-40,((SP_S_temp*SP_S_temp)-(Gf2*(((SP_S_temp1+SP_S_eta)-1.0)-(delta_nd*((SP_S_eta+1.0)+SP_S_xi0))))));
11443  SP_S_b = (1.0-(0.5*(Gf2*(SP_S_temp1-(delta_nd*SP_S_xi2)))));
11444  SP_S_c = ((2.0*SP_S_temp)+(Gf2*((1.0-SP_S_temp1)-(delta_nd*(1.0+SP_S_xi1)))));
11445  SP_S_tau = ((xn_d-SP_S_eta)+log((SP_S_a/Gf2)));
11446  nu = (SP_S_a+SP_S_c);
11447  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-(SP_S_a*SP_S_b))));
11448  SP_S_x0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-(SP_S_a*SP_S_b))))));
11449  if ((SP_S_x0<2.3025850929940458e+02))
11450  {
11451  SP_S_delta0 = exp(SP_S_x0);
11452  SP_S_delta1 = (1.0/SP_S_delta0);
11453  SP_S_delta0 = (delta_nd*SP_S_delta0);
11454  }
11455  else
11456  {
11457  if ((SP_S_x0>(xn_d-2.3025850929940458e+02)))
11458  {
11459  SP_S_delta0 = exp((SP_S_x0-xn_d));
11460  SP_S_delta1 = (delta_nd/SP_S_delta0);
11461  }
11462  else
11463  {
11464  SP_S_delta0 = (1.0e-100/(1.0+(((xn_d-SP_S_x0)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_d-SP_S_x0)-2.3025850929940458e+02)*(1.0+(((xn_d-SP_S_x0)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11465  SP_S_delta1 = (1.0e-100/(1.0+((SP_S_x0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_x0-2.3025850929940458e+02)*(1.0+((SP_S_x0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11466  }
11467  }
11468  SP_S_temp = (1.0/(2.0+(SP_S_x0*SP_S_x0)));
11469  SP_S_xi0 = ((SP_S_x0*SP_S_x0)*SP_S_temp);
11470  SP_S_xi1 = (4.0*((SP_S_x0*SP_S_temp)*SP_S_temp));
11471  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
11472  SP_S_temp = (xg-SP_S_x0);
11473  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((1.0-SP_S_delta1)+SP_S_delta0)-(delta_nd*(1.0+SP_S_xi1)))));
11474  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta1+SP_S_x0)-1.0)+SP_S_delta0)-(delta_nd*((SP_S_x0+1.0)+SP_S_xi0)))));
11475  SP_S_temp = (2.0-(Gf2*((SP_S_delta1+SP_S_delta0)-(delta_nd*SP_S_xi2))));
11476  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
11477  x_d = (SP_S_x0+(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
11478  }
11479  x_ds = (x_d-x_s);
11480  if ((x_ds<1.0E-10))
11481  {
11482  pC = ((2.0*(xg-x_s))+(Gf2*(((1.0-Es)+(delta_1s*k_ds))-(delta_nd*(1.0+xi1s)))));
11483  qC = ((Gf2*(1.0-k_ds))*Ds);
11484  temp = (2.0-(Gf2*((Es+(delta_1s*k_ds))-(delta_nd*xi2s))));
11485  temp = ((pC*pC)-(2.0*(temp*qC)));
11486  x_ds = (2.0*(qC/(pC+sqrt(temp))));
11487  x_d = (x_s+x_ds);
11488  }
11489  dps = (x_ds*phit1);
11490  xi0d = ((x_d*x_d)/(2.0+(x_d*x_d)));
11491  if ((x_d<2.3025850929940458e+02))
11492  {
11493  Ed = exp((-x_d));
11494  if ((x_d<1.0e-5))
11495  {
11496  Dd = (((((1.6666666666666667e-01*delta_nd)*x_d)*x_d)*x_d)*(1.0+(1.75*x_d)));
11497  }
11498  else
11499  {
11500  Dd = (delta_nd*((((1.0/Ed)-x_d)-1.0)-xi0d));
11501  }
11502  }
11503  else
11504  {
11505  if ((x_d>(xn_d-2.3025850929940458e+02)))
11506  {
11507  temp = exp((x_d-xn_d));
11508  Ed = (delta_nd/temp);
11509  Dd = (temp-(delta_nd*((x_d+1.0)+xi0d)));
11510  }
11511  else
11512  {
11513  Ed = (1.0e-100/(1.0+((x_d-2.3025850929940458e+02)*(1.0+(0.5*((x_d-2.3025850929940458e+02)*(1.0+((x_d-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11514  temp = (1.0e-100/(1.0+(((xn_d-x_d)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_d-x_d)-2.3025850929940458e+02)*(1.0+(((xn_d-x_d)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11515  Dd = (temp-(delta_nd*((x_d+1.0)+xi0d)));
11516  }
11517  }
11518  x_m = (0.5*(x_s+x_d));
11519  Em = 0.0;
11520  temp = (Ed*Es);
11521  if ((temp>0.0))
11522  {
11523  Em = sqrt(temp);
11524  }
11525  D_bar = (0.5*(Ds+Dd));
11526  Dm = (D_bar+(0.125*((x_ds*x_ds)*(Em-(2.0*inv_Gf2)))));
11527  if ((x_m<1.0e-5))
11528  {
11529  Pm = (0.5*((x_m*x_m)*(1.0-(3.3333333333333333e-01*(x_m*(1.0-(0.25*x_m)))))));
11530  xgm = (Gf*sqrt((Dm+Pm)));
11531  if ((kp>0.0))
11532  {
11533  eta_p = (1.0/sqrt((1.0+(kp*xgm))));
11534  }
11535  temp = sqrt((1.0-(3.3333333333333333e-01*(x_m*(1.0-(0.25*x_m))))));
11536  sqm = (7.0710678118654746e-01*(x_m*temp));
11537  alpha = (eta_p+(7.0710678118654746e-01*((Gf*((1.0-(0.5*x_m))+(1.6666666666666667e-01*(x_m*x_m))))/temp)));
11538  }
11539  else
11540  {
11541  Pm = ((x_m-1.0)+Em);
11542  xgm = (Gf*sqrt((Dm+Pm)));
11543  if ((kp>0.0))
11544  {
11545  d0 = ((1.0-Em)+(2.0*(xgm*inv_Gf2)));
11546  eta_p = (1.0/sqrt((1.0+(kp*xgm))));
11547  temp = (eta_p/(eta_p+1.0));
11548  x_pm = (kp*(((temp*temp)*Gf2)*Dm));
11549  p_pd = ((2.0*(xgm-x_pm))+(Gf2*((1.0-Em)+Dm)));
11550  q_pd = (x_pm*(x_pm-(2.0*xgm)));
11551  xi_pd = (1.0-(0.5*(Gf2*(Em+Dm))));
11552  u_pd = ((q_pd*p_pd)/((p_pd*p_pd)-(xi_pd*q_pd)));
11553  x_m = (x_m+u_pd);
11554  km = exp(u_pd);
11555  Em = (Em/km);
11556  Dm = (Dm*km);
11557  Pm = ((x_m-1.0)+Em);
11558  xgm = (Gf*sqrt((Dm+Pm)));
11559  help = ((1.0-Em)+(2.0*((xgm*eta_p)*inv_Gf2)));
11560  x_ds = (((x_ds*km)*(d0+D_bar))/(help+(km*D_bar)));
11561  dps = (x_ds*phit1);
11562  }
11563  sqm = sqrt(Pm);
11564  alpha = (eta_p+(0.5*((Gf*(1.0-Em))/sqm)));
11565  }
11566  qim = (phit1*((Gf2*Dm)/(xgm+(Gf*sqm))));
11567  qim1 = (qim+(phit1*alpha));
11568  qbm = ((sqm*Gf)*phit1);
11569  if ((RSG_i<0))
11570  {
11571  temp = (1.0-(RSG_i*qim));
11572  }
11573  else
11574  {
11575  temp = (1.0/(1.0+(RSG_i*qim)));
11576  }
11577  GR = (THER_i*((rhob*temp)*qim));
11578  qeff = (qbm+(eta_mu*qim));
11579  qeff1 = (qbm+(eta_mu1*qim));
11580  Eeffm = (E_eff0*qeff);
11581  if (((Eeffm*MUE_i)!=0))
11582  {
11583  Mutmp = (pow((Eeffm*MUE_i),THEMU_i)+(CS_i*(Pm/((Pm+Dm)+1.0e-14))));
11584  }
11585  else
11586  {
11587  Mutmp = (CS_i*(Pm/((Pm+Dm)+1.0e-14)));
11588  }
11589  Gmob = (((1.0+Mutmp)+GR)*Rxcor);
11590  s1 = log(((1.0+((Vds-dps)*inv_VP))/(1.0+((Vdse-dps)*inv_VP))));
11591  dL = (ALP_i*s1);
11592  GdL = (1.0/((1.0+dL)+(dL*dL)));
11593  temp2 = (qim*xitsb);
11594  wsat = (100.0*(temp2/(100.0+temp2)));
11595  Gmob_dL = (Gmob*GdL);
11596  if ((THESATG_i<0))
11597  {
11598  temp = (1/(1-(THESATG_i*wsat)));
11599  }
11600  else
11601  {
11602  temp = (1+(THESATG_i*wsat));
11603  }
11604  thesat1 = (THESAT_i*(temp/Gmob_dL));
11605  zsat = (((thesat1*thesat1)*dps)*dps);
11606  if (((model_.CHNL_TYPE)==(-1)))
11607  {
11608  zsat = (zsat/(1.0+(thesat1*dps)));
11609  }
11610  Gvsat = (0.5*(Gmob_dL*(1.0+sqrt((1.0+(2.0*zsat))))));
11611  Gvsatinv = (1.0/Gvsat);
11612  Voxm = (xgm*phit1);
11613  temp = (Gmob_dL*Gvsatinv);
11614  alpha1 = (alpha*(1.0+(0.5*((zsat*temp)*temp))));
11615  H = ((temp*qim1)/alpha1);
11616  }
11617  if ((xg>0.0))
11618  {
11619  qim1_1 = (1.0/qim1);
11620  r1 = (qim*qim1_1);
11621  r2 = (phit1*(alpha*qim1_1));
11622  s2 = log((1.0+(Vdsx*inv_VP)));
11623  dL1 = ((dL+(ALP1_i*((qim1_1*r1)*s1)))+(ALP2_i*(((qbm*r2)*r2)*s2)));
11624  FdL = (((1.0+dL1)+(dL1*dL1))*GdL);
11625  }
11626  xg_dc = xg;
11627  qeff1_dc = qeff1;
11628  Voxm_dc = Voxm;
11629  alpha_dc = alpha;
11630  dps_dc = dps;
11631  qim_dc = qim;
11632  qim1_dc = qim1;
11633  GdL_dc = GdL;
11634  FdL_dc = FdL;
11635  H_dc = H;
11636  eta_p_dc = eta_p;
11637  Gvsat_dc = Gvsat;
11638  Gvsatinv_dc = Gvsatinv;
11639  Gmob_dL_dc = Gmob_dL;
11640  x_ds_dc = x_ds;
11641  x_m_dc = x_m;
11642  Gf_dc = Gf;
11643  Vdsat_dc = Vdsat;
11644  Udse_dc = Udse;
11645  }
11646  // End block SPcalc_dc
11647  if ((xg_dc<=0))
11648  {
11649  Ids = 0.0;
11650  }
11651  else
11652  {
11653  Ids = (BET_i*(((FdL_dc*qim1_dc)*dps_dc)*Gvsatinv_dc));
11654  if (((model_.SWIMPACT_i)!=0))
11655  {
11656  delVsat = (Vds-(A3_i*dps_dc));
11657  if ((delVsat>0))
11658  {
11659  temp2 = (A2_i*((1.0+(A4_i*(sqrt((phib_dc+Vsbnud))-sqrt_phib_dc)))/(delVsat+1e-30)));
11660  if (((-temp2)>(-2.3025850929940458e+02)))
11661  {
11662  temp = exp((-temp2));
11663  }
11664  else
11665  {
11666  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-temp2))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-temp2))*(1.0+(((-2.3025850929940458e+02)-(-temp2))*3.3333333333333333e-01))))))));
11667  }
11668  mavl = (A1_i*(delVsat*temp));
11669  Iimpact = (Ids*mavl);
11670  }
11671  }
11672  }
11673  if (((((((model_.SWIGATE_i)!=0)&&((IGOV_i>0)||(IGOVD_i>0)))||(((model_.SWGIDL_i)!=0)&&((AGIDL_i>0)||(AGIDLD_i>0))))||(CGOV_i>0))||(CGOVD_i>0)))
11674  {
11675  GOV = GOV_s;
11676  GOV2 = GOV2_s;
11677  xi_ov = xi_ov_s;
11678  inv_xi_ov = inv_xi_ov_s;
11679  x_mrg_ov = x_mrg_ov_s;
11680  inv_xg1 = inv_xg1_s;
11681  if ((fabs(xgs_ov)<=x_mrg_ov))
11682  {
11683  xs_ov = ((-xgs_ov)*inv_xi_ov);
11684  }
11685  else
11686  {
11687  if ((xgs_ov<(-x_mrg_ov)))
11688  {
11689  SP_OV_yg = (-xgs_ov);
11690  SP_OV_z = ((x1*SP_OV_yg)*inv_xi_ov);
11691  SP_OV_eta = (0.5*((SP_OV_z+10.0)-sqrt((((SP_OV_z-6.0)*(SP_OV_z-6.0))+64.0))));
11692  SP_OV_a = (((SP_OV_yg-SP_OV_eta)*(SP_OV_yg-SP_OV_eta))+(GOV2*(SP_OV_eta+1.0)));
11693  SP_OV_c = ((2.0*(SP_OV_yg-SP_OV_eta))-GOV2);
11694  SP_OV_tau = (log((SP_OV_a/GOV2))-SP_OV_eta);
11695  nu = (SP_OV_a+SP_OV_c);
11696  mutau = ((nu*nu)+(SP_OV_tau*((0.5*(SP_OV_c*SP_OV_c))-SP_OV_a)));
11697  SP_OV_y0 = (SP_OV_eta+(((SP_OV_a*nu)*SP_OV_tau)/(mutau+(((((nu/mutau)*SP_OV_tau)*SP_OV_tau)*SP_OV_c)*(((SP_OV_c*SP_OV_c)*3.3333333333333333e-01)-SP_OV_a)))));
11698  SP_OV_D0 = exp(SP_OV_y0);
11699  SP_OV_temp = (SP_OV_yg-SP_OV_y0);
11700  SP_OV_p = ((2.0*SP_OV_temp)+(GOV2*(SP_OV_D0-1.0)));
11701  SP_OV_q = ((SP_OV_temp*SP_OV_temp)+(GOV2*((SP_OV_y0+1.0)-SP_OV_D0)));
11702  SP_OV_xi = (1.0-((GOV2*0.5)*SP_OV_D0));
11703  SP_OV_temp = ((SP_OV_p*SP_OV_p)-(4.0*(SP_OV_xi*SP_OV_q)));
11704  SP_OV_w = (2.0*(SP_OV_q/(SP_OV_p+sqrt(SP_OV_temp))));
11705  xs_ov = (-(SP_OV_y0+SP_OV_w));
11706  }
11707  else
11708  {
11709  SP_OV_Afac = ((((xi_ov*x1)*inv_xg1)-1.0)*inv_xg1);
11710  SP_OV_xbar = ((xgs_ov*inv_xi_ov)*(1.0+(SP_OV_Afac*xgs_ov)));
11711  if (((-SP_OV_xbar)>(-2.3025850929940458e+02)))
11712  {
11713  SP_OV_temp = exp((-SP_OV_xbar));
11714  }
11715  else
11716  {
11717  SP_OV_temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_OV_xbar))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_OV_xbar))*(1.0+(((-2.3025850929940458e+02)-(-SP_OV_xbar))*3.3333333333333333e-01))))))));
11718  }
11719  SP_OV_w = (1.0-SP_OV_temp);
11720  SP_OV_x0 = ((xgs_ov+(GOV2*0.5))-(GOV*sqrt(((xgs_ov+(GOV2*0.25))-SP_OV_w))));
11721  if (((-SP_OV_x0)>(-2.3025850929940458e+02)))
11722  {
11723  SP_OV_D0 = exp((-SP_OV_x0));
11724  }
11725  else
11726  {
11727  SP_OV_D0 = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_OV_x0))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_OV_x0))*(1.0+(((-2.3025850929940458e+02)-(-SP_OV_x0))*3.3333333333333333e-01))))))));
11728  }
11729  SP_OV_p = ((2.0*(xgs_ov-SP_OV_x0))+(GOV2*(1-SP_OV_D0)));
11730  SP_OV_q = (((xgs_ov-SP_OV_x0)*(xgs_ov-SP_OV_x0))-(GOV2*((SP_OV_x0-1.0)+SP_OV_D0)));
11731  SP_OV_xi = (1.0-((GOV2*0.5)*SP_OV_D0));
11732  SP_OV_temp = ((SP_OV_p*SP_OV_p)-(4.0*(SP_OV_xi*SP_OV_q)));
11733  SP_OV_u = (2.0*(SP_OV_q/(SP_OV_p+sqrt(SP_OV_temp))));
11734  xs_ov = (SP_OV_x0+SP_OV_u);
11735  }
11736  xs_ov = (-xs_ov);
11737  }
11738  GOV = GOV_d;
11739  GOV2 = GOV2_d;
11740  xi_ov = xi_ov_d;
11741  inv_xi_ov = inv_xi_ov_d;
11742  x_mrg_ov = x_mrg_ov_d;
11743  inv_xg1 = inv_xg1_d;
11744  if ((fabs(xgd_ov)<=x_mrg_ov))
11745  {
11746  xd_ov = ((-xgd_ov)*inv_xi_ov);
11747  }
11748  else
11749  {
11750  if ((xgd_ov<(-x_mrg_ov)))
11751  {
11752  SP_OV_yg = (-xgd_ov);
11753  SP_OV_z = ((x1*SP_OV_yg)*inv_xi_ov);
11754  SP_OV_eta = (0.5*((SP_OV_z+10.0)-sqrt((((SP_OV_z-6.0)*(SP_OV_z-6.0))+64.0))));
11755  SP_OV_a = (((SP_OV_yg-SP_OV_eta)*(SP_OV_yg-SP_OV_eta))+(GOV2*(SP_OV_eta+1.0)));
11756  SP_OV_c = ((2.0*(SP_OV_yg-SP_OV_eta))-GOV2);
11757  SP_OV_tau = (log((SP_OV_a/GOV2))-SP_OV_eta);
11758  nu = (SP_OV_a+SP_OV_c);
11759  mutau = ((nu*nu)+(SP_OV_tau*((0.5*(SP_OV_c*SP_OV_c))-SP_OV_a)));
11760  SP_OV_y0 = (SP_OV_eta+(((SP_OV_a*nu)*SP_OV_tau)/(mutau+(((((nu/mutau)*SP_OV_tau)*SP_OV_tau)*SP_OV_c)*(((SP_OV_c*SP_OV_c)*3.3333333333333333e-01)-SP_OV_a)))));
11761  SP_OV_D0 = exp(SP_OV_y0);
11762  SP_OV_temp = (SP_OV_yg-SP_OV_y0);
11763  SP_OV_p = ((2.0*SP_OV_temp)+(GOV2*(SP_OV_D0-1.0)));
11764  SP_OV_q = ((SP_OV_temp*SP_OV_temp)+(GOV2*((SP_OV_y0+1.0)-SP_OV_D0)));
11765  SP_OV_xi = (1.0-((GOV2*0.5)*SP_OV_D0));
11766  SP_OV_temp = ((SP_OV_p*SP_OV_p)-(4.0*(SP_OV_xi*SP_OV_q)));
11767  SP_OV_w = (2.0*(SP_OV_q/(SP_OV_p+sqrt(SP_OV_temp))));
11768  xd_ov = (-(SP_OV_y0+SP_OV_w));
11769  }
11770  else
11771  {
11772  SP_OV_Afac = ((((xi_ov*x1)*inv_xg1)-1.0)*inv_xg1);
11773  SP_OV_xbar = ((xgd_ov*inv_xi_ov)*(1.0+(SP_OV_Afac*xgd_ov)));
11774  if (((-SP_OV_xbar)>(-2.3025850929940458e+02)))
11775  {
11776  SP_OV_temp = exp((-SP_OV_xbar));
11777  }
11778  else
11779  {
11780  SP_OV_temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_OV_xbar))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_OV_xbar))*(1.0+(((-2.3025850929940458e+02)-(-SP_OV_xbar))*3.3333333333333333e-01))))))));
11781  }
11782  SP_OV_w = (1.0-SP_OV_temp);
11783  SP_OV_x0 = ((xgd_ov+(GOV2*0.5))-(GOV*sqrt(((xgd_ov+(GOV2*0.25))-SP_OV_w))));
11784  if (((-SP_OV_x0)>(-2.3025850929940458e+02)))
11785  {
11786  SP_OV_D0 = exp((-SP_OV_x0));
11787  }
11788  else
11789  {
11790  SP_OV_D0 = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_OV_x0))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_OV_x0))*(1.0+(((-2.3025850929940458e+02)-(-SP_OV_x0))*3.3333333333333333e-01))))))));
11791  }
11792  SP_OV_p = ((2.0*(xgd_ov-SP_OV_x0))+(GOV2*(1-SP_OV_D0)));
11793  SP_OV_q = (((xgd_ov-SP_OV_x0)*(xgd_ov-SP_OV_x0))-(GOV2*((SP_OV_x0-1.0)+SP_OV_D0)));
11794  SP_OV_xi = (1.0-((GOV2*0.5)*SP_OV_D0));
11795  SP_OV_temp = ((SP_OV_p*SP_OV_p)-(4.0*(SP_OV_xi*SP_OV_q)));
11796  SP_OV_u = (2.0*(SP_OV_q/(SP_OV_p+sqrt(SP_OV_temp))));
11797  xd_ov = (SP_OV_x0+SP_OV_u);
11798  }
11799  xd_ov = (-xd_ov);
11800  }
11801  Vovs = ((-(model_.phit))*(xgs_ov+xs_ov));
11802  Vovd = ((-(model_.phit))*(xgd_ov+xd_ov));
11803  }
11804  Igsov = 0.0;
11805  Igdov = 0.0;
11806  Igc = 0.0;
11807  Igb = 0.0;
11808  Igcs = 0.0;
11809  Igcd = 0.0;
11810  if (((model_.SWIGATE_i)!=0))
11811  {
11812  if ((IGOV_i>0))
11813  {
11814  arg2mina = (Vovs+Dov);
11815  psi_t = (0.5*((+arg2mina)-sqrt((((-arg2mina)*(-arg2mina))+0.01))));
11816  zg = (sqrt(((Vovs*Vovs)+1.0e-6))*inv_CHIB);
11817  if ((GC3_i<0))
11818  {
11819  zg = (0.5*((zg+GCQ)-sqrt((((zg-GCQ)*(zg-GCQ))+1.0e-6))));
11820  }
11821  arg1 = ((3.0+xs_ov)+(psi_t*(model_.inv_phit)));
11822  if ((fabs(arg1)<2.3025850929940458e+02))
11823  {
11824  Dsi = exp(arg1);
11825  }
11826  else
11827  {
11828  if ((arg1<(-2.3025850929940458e+02)))
11829  {
11830  Dsi = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11831  }
11832  else
11833  {
11834  Dsi = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11835  }
11836  }
11837  arg1 = ((-VgsPrime)*(model_.inv_phit));
11838  if ((fabs(arg1)<2.3025850929940458e+02))
11839  {
11840  temp = exp(arg1);
11841  }
11842  else
11843  {
11844  if ((arg1<(-2.3025850929940458e+02)))
11845  {
11846  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11847  }
11848  else
11849  {
11850  temp = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11851  }
11852  }
11853  Dgate = (Dsi*temp);
11854  temp = (BOV*((-1.5)+(zg*(GC2_i+(GC3_i*zg)))));
11855  if ((temp>0))
11856  {
11857  TP = (1.0+(temp*(1.0+(0.5*(temp*(1.0+(temp*3.3333333333333333e-01)))))));
11858  }
11859  else
11860  {
11861  if ((temp>(-2.3025850929940458e+02)))
11862  {
11863  TP = exp(temp);
11864  }
11865  else
11866  {
11867  TP = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
11868  }
11869  }
11870  Igsov = (IGOV_i*(TP*log(((1.0+Dsi)/(1.0+Dgate)))));
11871  }
11872  if ((IGOVD_i>0))
11873  {
11874  arg2mina = (Vovd+Dov);
11875  psi_t = (0.5*((+arg2mina)-sqrt((((-arg2mina)*(-arg2mina))+0.01))));
11876  zg = (sqrt(((Vovd*Vovd)+1.0e-6))*inv_CHIB);
11877  if ((GC3_i<0))
11878  {
11879  zg = (0.5*((zg+GCQ)-sqrt((((zg-GCQ)*(zg-GCQ))+1.0e-6))));
11880  }
11881  arg1 = ((3.0+xd_ov)+(psi_t*(model_.inv_phit)));
11882  if ((fabs(arg1)<2.3025850929940458e+02))
11883  {
11884  Dsi = exp(arg1);
11885  }
11886  else
11887  {
11888  if ((arg1<(-2.3025850929940458e+02)))
11889  {
11890  Dsi = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11891  }
11892  else
11893  {
11894  Dsi = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11895  }
11896  }
11897  arg1 = ((-VgdPrime)*(model_.inv_phit));
11898  if ((fabs(arg1)<2.3025850929940458e+02))
11899  {
11900  temp = exp(arg1);
11901  }
11902  else
11903  {
11904  if ((arg1<(-2.3025850929940458e+02)))
11905  {
11906  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11907  }
11908  else
11909  {
11910  temp = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11911  }
11912  }
11913  Dgate = (Dsi*temp);
11914  temp = (BOV_d*((-1.5)+(zg*(GC2_i+(GC3_i*zg)))));
11915  if ((temp>0))
11916  {
11917  TP = (1.0+(temp*(1.0+(0.5*(temp*(1.0+(temp*3.3333333333333333e-01)))))));
11918  }
11919  else
11920  {
11921  if ((temp>(-2.3025850929940458e+02)))
11922  {
11923  TP = exp(temp);
11924  }
11925  else
11926  {
11927  TP = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
11928  }
11929  }
11930  Igdov = (IGOVD_i*(TP*log(((1.0+Dsi)/(1.0+Dgate)))));
11931  }
11932  if ((IGINV_i>0))
11933  {
11934  if ((xg_dc<=0.0))
11935  {
11936  temp = pow((Vds/Vdsat_lim),AX_i);
11937  Udse_dc = ((Vds*pow((1.0+temp),(-inv_AX)))*inv_phit1);
11938  }
11939  if (((x_ds_dc-Udse_dc)>(-2.3025850929940458e+02)))
11940  {
11941  temp = exp((x_ds_dc-Udse_dc));
11942  }
11943  else
11944  {
11945  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(x_ds_dc-Udse_dc))*(1.0+(0.5*(((-2.3025850929940458e+02)-(x_ds_dc-Udse_dc))*(1.0+(((-2.3025850929940458e+02)-(x_ds_dc-Udse_dc))*3.3333333333333333e-01))))))));
11946  }
11947  Vm = (Vsbnud+(phit1*((0.5*x_ds_dc)-log((0.5*(1.0+temp))))));
11948  arg2mina = (Voxm_dc+Dch);
11949  psi_t = (0.5*((+arg2mina)-sqrt((((-arg2mina)*(-arg2mina))+0.01))));
11950  zg = (sqrt(((Voxm_dc*Voxm_dc)+1.0e-6))*inv_CHIB);
11951  if ((GC3_i<0))
11952  {
11953  zg = (0.5*((zg+GCQ)-sqrt((((zg-GCQ)*(zg-GCQ))+1.0e-06))));
11954  }
11955  arg1 = (x_m_dc+(((psi_t-alpha_b)-Vm)*inv_phit1));
11956  if ((fabs(arg1)<2.3025850929940458e+02))
11957  {
11958  Dsi = exp(arg1);
11959  }
11960  else
11961  {
11962  if ((arg1<(-2.3025850929940458e+02)))
11963  {
11964  Dsi = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11965  }
11966  else
11967  {
11968  Dsi = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11969  }
11970  }
11971  arg1 = ((-((Vgs+Vsbnud)-Vm))*inv_phit1);
11972  if ((fabs(arg1)<2.3025850929940458e+02))
11973  {
11974  temp = exp(arg1);
11975  }
11976  else
11977  {
11978  if ((arg1<(-2.3025850929940458e+02)))
11979  {
11980  temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-arg1)*(1.0+(0.5*(((-2.3025850929940458e+02)-arg1)*(1.0+(((-2.3025850929940458e+02)-arg1)*3.3333333333333333e-01))))))));
11981  }
11982  else
11983  {
11984  temp = (1.0e100*(1.0+((arg1-2.3025850929940458e+02)*(1.0+(0.5*((arg1-2.3025850929940458e+02)*(1.0+((arg1-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
11985  }
11986  }
11987  Dgate = (Dsi*temp);
11988  temp = (BCH*((-1.5)+(zg*(GC2_i+(GC3_i*zg)))));
11989  if ((temp>0))
11990  {
11991  TP = (1.0+(temp*(1.0+(0.5*(temp*(1.0+(temp*3.3333333333333333e-01)))))));
11992  }
11993  else
11994  {
11995  if ((temp>(-2.3025850929940458e+02)))
11996  {
11997  TP = exp(temp);
11998  }
11999  else
12000  {
12001  TP = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
12002  }
12003  }
12004  Igc0 = (IGINV_i*(TP*log(((1.0+Dsi)/(1.0+Dgate)))));
12005  if (((xg_dc<=0)||((GC2_i==0)&&(GC3_i==0))))
12006  {
12007  igc = 1.0;
12008  igcd_h = 0.5;
12009  }
12010  else
12011  {
12012  temp = (GC2_i+((2.0*GC3_i)*zg));
12013  u0 = (CHIB_i/(temp*BCH));
12014  x = (0.5*(dps_dc/u0));
12015  u0_div_H = (u0/H_dc);
12016  Bg = ((u0_div_H*(1.0-u0_div_H))*0.5);
12017  Ag = (0.5-(3.0*Bg));
12018  if ((x<1.0e-3))
12019  {
12020  xsq = (x*x);
12021  igc = (1.0+(xsq*((1.6666666666666667e-01+(u0_div_H*3.3333333333333333e-01))+(1.6666666666666667e-01*(xsq*(0.05+(0.2*u0_div_H)))))));
12022  igcd_h = ((0.5*igc)-(1.6666666666666667e-01*(x*(1.0+(xsq*((0.4*(Bg+0.25))+(0.0285714285714*(xsq*(0.125+Bg)))))))));
12023  }
12024  else
12025  {
12026  inv_x = (1.0/x);
12027  if ((fabs(x)<2.3025850929940458e+02))
12028  {
12029  ex = exp(x);
12030  }
12031  else
12032  {
12033  if ((x<(-2.3025850929940458e+02)))
12034  {
12035  ex = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-x)*(1.0+(0.5*(((-2.3025850929940458e+02)-x)*(1.0+(((-2.3025850929940458e+02)-x)*3.3333333333333333e-01))))))));
12036  }
12037  else
12038  {
12039  ex = (1.0e100*(1.0+((x-2.3025850929940458e+02)*(1.0+(0.5*((x-2.3025850929940458e+02)*(1.0+((x-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12040  }
12041  }
12042  inv_ex = (1.0/ex);
12043  temp = (ex-inv_ex);
12044  temp2 = (ex+inv_ex);
12045  igc = (0.5*((((1.0-u0_div_H)*temp)*inv_x)+(u0_div_H*temp2)));
12046  igcd_h = (0.5*((igc-(temp*(Bg-((Ag*inv_x)*inv_x))))-((Ag*temp2)*inv_x)));
12047  }
12048  }
12049  Sg = (0.5*(1.0+(xg_dc/sqrt(((xg_dc*xg_dc)+1.0e-6)))));
12050  Igc = ((Igc0*igc)*Sg);
12051  Igcd = ((Igc0*igcd_h)*Sg);
12052  Igcs = (Igc-Igcd);
12053  Igb = ((Igc0*igc)*(1.0-Sg));
12054  }
12055  }
12056  Igidl = 0.0;
12057  Igisl = 0.0;
12058  if (((model_.SWGIDL_i)!=0))
12059  {
12060  if (((AGIDLD_i>0)&&(Vovd<0)))
12061  {
12062  Vtovd = sqrt((((Vovd*Vovd)+((CGIDLD_i*CGIDLD_i)*(VdbPrime*VdbPrime)))+1.0e-6));
12063  temp = ((-BGIDLD_i)/Vtovd);
12064  if ((temp>(-2.3025850929940458e+02)))
12065  {
12066  temp2 = exp(temp);
12067  }
12068  else
12069  {
12070  temp2 = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
12071  }
12072  Igidl = ((-AGIDLD_i)*(((VdbPrime*Vovd)*Vtovd)*temp2));
12073  }
12074  if (((AGIDL_i>0)&&(Vovs<0)))
12075  {
12076  Vtovs = sqrt((((Vovs*Vovs)+((CGIDL_i*CGIDL_i)*(VsbPrime*VsbPrime)))+1.0e-6));
12077  temp = ((-BGIDL_i)/Vtovs);
12078  if ((temp>(-2.3025850929940458e+02)))
12079  {
12080  temp2 = exp(temp);
12081  }
12082  else
12083  {
12084  temp2 = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-temp)*(1.0+(0.5*(((-2.3025850929940458e+02)-temp)*(1.0+(((-2.3025850929940458e+02)-temp)*3.3333333333333333e-01))))))));
12085  }
12086  Igisl = ((-AGIDL_i)*(((VsbPrime*Vovs)*Vtovs)*temp2));
12087  }
12088  }
12089  }
12090  // End block evaluateStatic
12091  //Begin block evaluateDynamic
12092  {
12093  //Begin block SPcalc_ac
12094  {
12095  //Block-local variables for block SPcalc_ac
12096  double phib;
12097  double G_0;
12098  double sqrt_phib;
12099  AdmsFadType Vsbstar;
12100  AdmsFadType Vsbx;
12101  //End of Block-local variables
12102  //Block-local variables for block SPcalc_ac
12103  AdmsFadType xg;
12104  AdmsFadType qeff;
12105  AdmsFadType qeff1;
12106  AdmsFadType Voxm;
12107  AdmsFadType alpha;
12108  AdmsFadType dps;
12109  AdmsFadType qim;
12110  AdmsFadType qim1;
12111  AdmsFadType GdL;
12112  AdmsFadType H;
12113  AdmsFadType eta_p;
12114  AdmsFadType s1;
12115  //End of Block-local variables
12116  //Block-local variables for block SPcalc_ac
12117  AdmsFadType Gvsat;
12118  AdmsFadType Gvsatinv;
12119  AdmsFadType Gmob_dL;
12120  AdmsFadType x_ds;
12121  AdmsFadType x_m;
12122  //End of Block-local variables
12123  //Block-local variables for block SPcalc_ac
12124  AdmsFadType Dnsub;
12125  //End of Block-local variables
12126  //Block-local variables for block SPcalc_ac
12127  AdmsFadType x_s;
12128  AdmsFadType sqm;
12129  AdmsFadType alpha1;
12130  AdmsFadType phi_inf;
12131  AdmsFadType za;
12132  AdmsFadType xitsb;
12133  AdmsFadType rhob;
12134  //End of Block-local variables
12135  //Block-local variables for block SPcalc_ac
12136  AdmsFadType thesat1;
12137  AdmsFadType wsat;
12138  AdmsFadType ysat;
12139  AdmsFadType zsat;
12140  AdmsFadType dL;
12141  AdmsFadType GR;
12142  AdmsFadType Gmob;
12143  //End of Block-local variables
12144  //Block-local variables for block SPcalc_ac
12145  AdmsFadType xgm;
12146  AdmsFadType Ux;
12147  //End of Block-local variables
12148  //Block-local variables for block SPcalc_ac
12149  AdmsFadType xn_s;
12150  AdmsFadType delta_ns;
12151  //End of Block-local variables
12152  //Block-local variables for block SPcalc_ac
12153  AdmsFadType Gf;
12154  AdmsFadType Gf2;
12155  AdmsFadType inv_Gf2;
12156  AdmsFadType xi;
12157  AdmsFadType inv_xi;
12158  AdmsFadType margin;
12159  //End of Block-local variables
12160  //Block-local variables for block SPcalc_ac
12161  AdmsFadType SP_xg1;
12162  AdmsFadType SP_S_temp;
12163  AdmsFadType SP_S_temp1;
12164  AdmsFadType SP_S_temp2;
12165  //End of Block-local variables
12166  //Block-local variables for block SPcalc_ac
12167  AdmsFadType SP_S_yg;
12168  AdmsFadType SP_S_ysub;
12169  AdmsFadType SP_S_y0;
12170  AdmsFadType SP_S_a;
12171  AdmsFadType SP_S_b;
12172  AdmsFadType SP_S_c;
12173  //End of Block-local variables
12174  //Block-local variables for block SPcalc_ac
12175  AdmsFadType SP_S_bx;
12176  AdmsFadType SP_S_tau;
12177  AdmsFadType SP_S_eta;
12178  AdmsFadType SP_S_delta0;
12179  AdmsFadType SP_S_delta1;
12180  //End of Block-local variables
12181  //Block-local variables for block SPcalc_ac
12182  AdmsFadType SP_S_pC;
12183  AdmsFadType SP_S_qC;
12184  AdmsFadType SP_S_A_fac;
12185  //End of Block-local variables
12186  //Block-local variables for block SPcalc_ac
12187  AdmsFadType SP_S_x1;
12188  AdmsFadType SP_S_w;
12189  AdmsFadType SP_S_xbar;
12190  AdmsFadType SP_S_x0;
12191  //End of Block-local variables
12192  //Block-local variables for block SPcalc_ac
12193  AdmsFadType SP_S_xi0;
12194  AdmsFadType SP_S_xi1;
12195  AdmsFadType SP_S_xi2;
12196  //End of Block-local variables
12197  //Block-local variables for block SPcalc_ac
12198  AdmsFadType x_d;
12199  AdmsFadType Rxcor;
12200  AdmsFadType delta_1s;
12201  AdmsFadType xi0s;
12202  AdmsFadType xi1s;
12203  AdmsFadType xi2s;
12204  AdmsFadType xi0d;
12205  //End of Block-local variables
12206  //Block-local variables for block SPcalc_ac
12207  AdmsFadType Es;
12208  AdmsFadType Em;
12209  AdmsFadType Ed;
12210  AdmsFadType Ds;
12211  AdmsFadType Dm;
12212  AdmsFadType Dd;
12213  AdmsFadType Ps;
12214  AdmsFadType xgs;
12215  AdmsFadType qis;
12216  AdmsFadType qbs;
12217  AdmsFadType qbm;
12218  AdmsFadType Eeffm;
12219  //End of Block-local variables
12220  //Block-local variables for block SPcalc_ac
12221  AdmsFadType Phi_0;
12222  AdmsFadType Phi_2;
12223  AdmsFadType asat;
12224  AdmsFadType Phi_0_2;
12225  AdmsFadType Phi0_Phi2;
12226  //End of Block-local variables
12227  //Block-local variables for block SPcalc_ac
12228  AdmsFadType Vdse;
12229  AdmsFadType Vdsat;
12230  AdmsFadType Udse;
12231  AdmsFadType xn_d;
12232  AdmsFadType k_ds;
12233  //End of Block-local variables
12234  //Block-local variables for block SPcalc_ac
12235  AdmsFadType Mutmp;
12236  AdmsFadType Phi_sat;
12237  AdmsFadType delta_nd;
12238  //End of Block-local variables
12239  //Block-local variables for block SPcalc_ac
12240  AdmsFadType pC;
12241  AdmsFadType qC;
12242  AdmsFadType Pm;
12243  //End of Block-local variables
12244  //Block-local variables for block SPcalc_ac
12245  AdmsFadType d0;
12246  AdmsFadType D_bar;
12247  AdmsFadType km;
12248  AdmsFadType x_pm;
12249  AdmsFadType xi_pd;
12250  AdmsFadType p_pd;
12251  AdmsFadType u_pd;
12252  AdmsFadType q_pd;
12253  //End of Block-local variables
12254  if ((((model_.SWNUD_i)==1)||((model_.SWDELVTAC_i)!=0)))
12255  {
12256  if (((model_.SWDELVTAC_i)!=0))
12257  {
12258  temp = ((0.5*((Vdb+Vsb)-sqrt((((Vdb-Vsb)*(Vdb-Vsb))+bphi_ac))))+phix_ac);
12259  Vsbstar_ac = ((Vsb-(0.5*((temp)-sqrt((((temp)*(temp))+aphi_ac)))))+phix1_ac);
12260  Vsbstar = Vsbstar_ac;
12261  phib = phib_ac;
12262  G_0 = G_0_ac;
12263  sqrt_phib = sqrt_phib_ac;
12264  }
12265  else
12266  {
12267  Vsbstar = Vsbstar_dc;
12268  phib = phib_dc;
12269  G_0 = G_0_dc;
12270  sqrt_phib = sqrt_phib_dc;
12271  }
12272  alpha = 0.0;
12273  GdL = 1.0;
12274  dL = 0.0;
12275  qbm = 0.0;
12276  dps = 0.0;
12277  qim = 0.0;
12278  qim1 = 0.0;
12279  H = 1.0;
12280  eta_p = 1.0;
12281  Gvsat = 1.0;
12282  Gvsatinv = 1.0;
12283  SP_S_x1 = 0.0;
12284  x_s = 0.0;
12285  sqm = 0.0;
12286  xitsb = 0.0;
12287  rhob = 0.0;
12288  Gmob = 1.0;
12289  Gmob_dL = 1.0;
12290  Udse = 0.0;
12291  thesat1 = 0.0;
12292  xgm = 0.0;
12293  Vdbstar = (Vds+Vsbstar);
12294  Vgbstar = (Vgs+Vsbstar);
12295  Vgb1 = (Vgbstar-VFB_i);
12296  Vsbx = (Vsbstar+(0.5*(Vds-Vdsx)));
12297  delVg = (CF_i*(Vdsx*(1+(CFB_i*Vsbx))));
12298  Vgb1 = (Vgb1+delVg);
12299  xg = (Vgb1*inv_phit1);
12300  if ((DNSUB_i>0.0))
12301  {
12302  Dnsub = ((DNSUB_i*0.5)*((+((Vgs+Vsb)-VNSUB_i))+sqrt((((-((Vgs+Vsb)-VNSUB_i))*(-((Vgs+Vsb)-VNSUB_i)))+NSLP_i))));
12303  Gf = (G_0*sqrt((1.0+Dnsub)));
12304  }
12305  else
12306  {
12307  Gf = G_0;
12308  }
12309  Gf2 = (Gf*Gf);
12310  inv_Gf2 = (1.0/Gf2);
12311  xi = (1.0+(Gf*7.0710678118654746e-01));
12312  inv_xi = (1.0/xi);
12313  Ux = (Vsbstar*inv_phit1);
12314  xn_s = ((phib*inv_phit1)+Ux);
12315  if ((xn_s<4.6051701859880916e+02))
12316  {
12317  delta_ns = exp((-xn_s));
12318  }
12319  else
12320  {
12321  delta_ns = (1.0e-200/(1.0+((xn_s-4.6051701859880916e+02)*(1.0+(0.5*((xn_s-4.6051701859880916e+02)*(1.0+((xn_s-4.6051701859880916e+02)*3.3333333333333333e-01))))))));
12322  }
12323  margin = (1e-5*xi);
12324  if ((fabs(xg)<=margin))
12325  {
12326  SP_S_temp1 = (((inv_xi*inv_xi)*1.6666666666666667e-01)*7.0710678118654746e-01);
12327  x_s = ((xg*inv_xi)*(1.0+(((xg*(1.0-delta_ns))*Gf)*SP_S_temp1)));
12328  }
12329  else
12330  {
12331  if ((xg<(-margin)))
12332  {
12333  SP_S_yg = (-xg);
12334  SP_S_ysub = (1.25*(SP_S_yg*inv_xi));
12335  SP_S_eta = (0.5*((SP_S_ysub+10)-sqrt((((SP_S_ysub-6.0)*(SP_S_ysub-6.0))+64.0))));
12336  SP_S_temp = (SP_S_yg-SP_S_eta);
12337  SP_S_a = ((SP_S_temp*SP_S_temp)+(Gf2*(SP_S_eta+1.0)));
12338  SP_S_c = ((2.0*SP_S_temp)-Gf2);
12339  SP_S_tau = ((-SP_S_eta)+log((SP_S_a*inv_Gf2)));
12340  nu = (SP_S_a+SP_S_c);
12341  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-SP_S_a)));
12342  SP_S_y0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-SP_S_a)))));
12343  if ((SP_S_y0<2.3025850929940458e+02))
12344  {
12345  SP_S_delta0 = exp(SP_S_y0);
12346  }
12347  else
12348  {
12349  SP_S_delta0 = (1.0e100*(1.0+((SP_S_y0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_y0-2.3025850929940458e+02)*(1.0+((SP_S_y0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12350  }
12351  SP_S_delta1 = (1.0/SP_S_delta0);
12352  SP_S_temp = (1.0/(2.0+(SP_S_y0*SP_S_y0)));
12353  SP_S_xi0 = ((SP_S_y0*SP_S_y0)*SP_S_temp);
12354  SP_S_xi1 = (4.0*((SP_S_y0*SP_S_temp)*SP_S_temp));
12355  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
12356  SP_S_temp = (SP_S_yg-SP_S_y0);
12357  SP_S_temp1 = (delta_ns*SP_S_delta1);
12358  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((SP_S_delta0-1.0)-SP_S_temp1)+(delta_ns*(1.0-SP_S_xi1)))));
12359  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta0-SP_S_y0)-1.0)+SP_S_temp1)+(delta_ns*((SP_S_y0-1.0)-SP_S_xi0)))));
12360  SP_S_temp = (2.0-(Gf2*((SP_S_delta0+SP_S_temp1)-(delta_ns*SP_S_xi2))));
12361  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
12362  x_s = ((-SP_S_y0)-(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
12363  }
12364  else
12365  {
12366  SP_xg1 = (1.0/(x1+(Gf*7.324648775608221e-001)));
12367  SP_S_A_fac = ((((xi*x1)*SP_xg1)-1.0)*SP_xg1);
12368  SP_S_xbar = ((xg*inv_xi)*(1.0+(SP_S_A_fac*xg)));
12369  if (((-SP_S_xbar)>(-2.3025850929940458e+02)))
12370  {
12371  SP_S_temp = exp((-SP_S_xbar));
12372  }
12373  else
12374  {
12375  SP_S_temp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(-SP_S_xbar))*(1.0+(0.5*(((-2.3025850929940458e+02)-(-SP_S_xbar))*(1.0+(((-2.3025850929940458e+02)-(-SP_S_xbar))*3.3333333333333333e-01))))))));
12376  }
12377  SP_S_w = (1.0-SP_S_temp);
12378  SP_S_x1 = ((xg+(Gf2*0.5))-(Gf*sqrt(((xg+(Gf2*0.25))-SP_S_w))));
12379  SP_S_bx = (xn_s+3.0);
12380  SP_S_eta = ((0.5*((SP_S_x1+SP_S_bx)-sqrt((((SP_S_x1-SP_S_bx)*(SP_S_x1-SP_S_bx))+5.0))))-(0.5*(SP_S_bx-sqrt(((SP_S_bx*SP_S_bx)+5.0)))));
12381  SP_S_temp = (xg-SP_S_eta);
12382  SP_S_temp1 = exp((-SP_S_eta));
12383  SP_S_temp2 = (1.0/(2.0+(SP_S_eta*SP_S_eta)));
12384  SP_S_xi0 = ((SP_S_eta*SP_S_eta)*SP_S_temp2);
12385  SP_S_xi1 = (4.0*((SP_S_eta*SP_S_temp2)*SP_S_temp2));
12386  SP_S_xi2 = ((((8.0*SP_S_temp2)-(12.0*SP_S_xi0))*SP_S_temp2)*SP_S_temp2);
12387  SP_S_a = max(1.0e-40,((SP_S_temp*SP_S_temp)-(Gf2*(((SP_S_temp1+SP_S_eta)-1.0)-(delta_ns*((SP_S_eta+1.0)+SP_S_xi0))))));
12388  SP_S_b = (1.0-(0.5*(Gf2*(SP_S_temp1-(delta_ns*SP_S_xi2)))));
12389  SP_S_c = ((2.0*SP_S_temp)+(Gf2*((1.0-SP_S_temp1)-(delta_ns*(1.0+SP_S_xi1)))));
12390  SP_S_tau = ((xn_s-SP_S_eta)+log((SP_S_a/Gf2)));
12391  nu = (SP_S_a+SP_S_c);
12392  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-(SP_S_a*SP_S_b))));
12393  SP_S_x0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-(SP_S_a*SP_S_b))))));
12394  if ((SP_S_x0<2.3025850929940458e+02))
12395  {
12396  SP_S_delta0 = exp(SP_S_x0);
12397  SP_S_delta1 = (1.0/SP_S_delta0);
12398  SP_S_delta0 = (delta_ns*SP_S_delta0);
12399  }
12400  else
12401  {
12402  if ((SP_S_x0>(xn_s-2.3025850929940458e+02)))
12403  {
12404  SP_S_delta0 = exp((SP_S_x0-xn_s));
12405  SP_S_delta1 = (delta_ns/SP_S_delta0);
12406  }
12407  else
12408  {
12409  SP_S_delta0 = (1.0e-100/(1.0+(((xn_s-SP_S_x0)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_s-SP_S_x0)-2.3025850929940458e+02)*(1.0+(((xn_s-SP_S_x0)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12410  SP_S_delta1 = (1.0e-100/(1.0+((SP_S_x0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_x0-2.3025850929940458e+02)*(1.0+((SP_S_x0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12411  }
12412  }
12413  SP_S_temp = (1.0/(2.0+(SP_S_x0*SP_S_x0)));
12414  SP_S_xi0 = ((SP_S_x0*SP_S_x0)*SP_S_temp);
12415  SP_S_xi1 = (4.0*((SP_S_x0*SP_S_temp)*SP_S_temp));
12416  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
12417  SP_S_temp = (xg-SP_S_x0);
12418  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((1.0-SP_S_delta1)+SP_S_delta0)-(delta_ns*(1.0+SP_S_xi1)))));
12419  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta1+SP_S_x0)-1.0)+SP_S_delta0)-(delta_ns*((SP_S_x0+1.0)+SP_S_xi0)))));
12420  SP_S_temp = (2.0-(Gf2*((SP_S_delta1+SP_S_delta0)-(delta_ns*SP_S_xi2))));
12421  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
12422  x_s = (SP_S_x0+(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
12423  }
12424  }
12425  x_d = x_s;
12426  x_m = x_s;
12427  x_ds = 0.0;
12428  if ((xg<=0.0))
12429  {
12430  qis = 0.0;
12431  xgm = (xg-x_s);
12432  Voxm = (xgm*phit1);
12433  qeff1 = Voxm;
12434  Vdsat = Vdsat_lim;
12435  }
12436  else
12437  {
12438  delta_1s = 0.0;
12439  temp = (1.0/(2.0+(x_s*x_s)));
12440  xi0s = ((x_s*x_s)*temp);
12441  xi1s = (4.0*((x_s*temp)*temp));
12442  xi2s = ((((8.0*temp)-(12.0*xi0s))*temp)*temp);
12443  if ((x_s<2.3025850929940458e+02))
12444  {
12445  delta_1s = exp(x_s);
12446  Es = (1.0/delta_1s);
12447  delta_1s = (delta_ns*delta_1s);
12448  }
12449  else
12450  {
12451  if ((x_s>(xn_s-2.3025850929940458e+02)))
12452  {
12453  delta_1s = exp((x_s-xn_s));
12454  Es = (delta_ns/delta_1s);
12455  }
12456  else
12457  {
12458  delta_1s = (1.0e-100/(1.0+(((xn_s-x_s)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_s-x_s)-2.3025850929940458e+02)*(1.0+(((xn_s-x_s)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12459  Es = (1.0e-100/(1.0+((x_s-2.3025850929940458e+02)*(1.0+(0.5*((x_s-2.3025850929940458e+02)*(1.0+((x_s-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12460  }
12461  }
12462  Ds = (delta_1s-(delta_ns*((x_s+1.0)+xi0s)));
12463  if ((x_s<1.0e-5))
12464  {
12465  Ps = (0.5*((x_s*x_s)*(1.0-(3.3333333333333333e-01*(x_s*(1.0-(0.25*x_s)))))));
12466  Ds = (1.6666666666666667e-01*((((delta_ns*x_s)*x_s)*x_s)*(1.0+(1.75*x_s))));
12467  temp = sqrt((1.0-(3.3333333333333333e-01*(x_s*(1.0-(0.25*x_s))))));
12468  sqm = (7.0710678118654746e-01*(x_s*temp));
12469  alpha = (1.0+(((Gf*7.0710678118654746e-01)*((1.0-(0.5*x_s))+(1.6666666666666667e-01*(x_s*x_s))))/temp));
12470  }
12471  else
12472  {
12473  Ps = ((x_s-1.0)+Es);
12474  sqm = sqrt(Ps);
12475  alpha = (1.0+(0.5*((Gf*(1.0-Es))/sqm)));
12476  }
12477  Em = Es;
12478  Ed = Em;
12479  Dm = Ds;
12480  Dd = Dm;
12481  Rxcor = ((1.0+((0.2*XCOR_i)*Vsbx))/(1.0+(XCOR_i*Vsbx)));
12482  if ((Ds>1.0e-100))
12483  {
12484  xgs = (Gf*sqrt((Ps+Ds)));
12485  qis = (((Gf2*Ds)*phit1)/(xgs+(Gf*sqm)));
12486  qbs = ((sqm*Gf)*phit1);
12487  if ((RSB_i<0))
12488  {
12489  rhob = (1.0/(1.0-(RSB_i*Vsbx)));
12490  }
12491  else
12492  {
12493  rhob = (1.0+(RSB_i*Vsbx));
12494  }
12495  if ((RSG_i<0))
12496  {
12497  temp = (1.0-(RSG_i*qis));
12498  }
12499  else
12500  {
12501  temp = (1.0/(1.0+(RSG_i*qis)));
12502  }
12503  GR = (THER_i*((rhob*temp)*qis));
12504  Eeffm = (E_eff0*(qbs+(eta_mu*qis)));
12505  if (((Eeffm*MUE_i)!=0))
12506  {
12507  Mutmp = (pow((Eeffm*MUE_i),THEMU_i)+(CS_i*(Ps/((Ps+Ds)+1.0e-14))));
12508  }
12509  else
12510  {
12511  Mutmp = (CS_i*(Ps/((Ps+Ds)+1.0e-14)));
12512  }
12513  Gmob = (((1.0+Mutmp)+GR)*Rxcor);
12514  if ((THESATB_i<0))
12515  {
12516  xitsb = (1.0/(1.0-(THESATB_i*Vsbx)));
12517  }
12518  else
12519  {
12520  xitsb = (1.0+(THESATB_i*Vsbx));
12521  }
12522  temp2 = (qis*xitsb);
12523  wsat = (100.0*(temp2/(100.0+temp2)));
12524  if ((THESATG_i<0))
12525  {
12526  temp = (1/(1-(THESATG_i*wsat)));
12527  }
12528  else
12529  {
12530  temp = (1+(THESATG_i*wsat));
12531  }
12532  thesat1 = (THESAT_i*(temp/Gmob));
12533  phi_inf = ((qis/alpha)+phit1);
12534  ysat = ((thesat1*phi_inf)*7.0710678118654746e-01);
12535  if (((model_.CHNL_TYPE)==(-1)))
12536  {
12537  ysat = (ysat/sqrt((1.0+ysat)));
12538  }
12539  za = (2.0/(1.0+sqrt((1.0+(4.0*ysat)))));
12540  temp1 = (za*ysat);
12541  Phi_0 = ((phi_inf*za)*(1.0+(0.86*((temp1*(1.0-(temp1*za)))/(1.0+(4.0*((temp1*temp1)*za)))))));
12542  asat = (xgs+(0.5*Gf2));
12543  Phi_2 = (0.98*(((Gf2*Ds)*phit1)/(asat+sqrt(((asat*asat)-((Gf2*Ds)*0.98))))));
12544  Phi_0_2 = (Phi_0+Phi_2);
12545  Phi0_Phi2 = (2.0*(Phi_0*Phi_2));
12546  Phi_sat = (Phi0_Phi2/(Phi_0_2+sqrt(((Phi_0_2*Phi_0_2)-(1.98*Phi0_Phi2)))));
12547  Vdsat = (Phi_sat-(phit1*log((1.0+(((Phi_sat*(Phi_sat-((2.0*asat)*phit1)))*inv_Gf2)/((phit1*phit1)*Ds))))));
12548  }
12549  else
12550  {
12551  Vdsat = Vdsat_lim;
12552  }
12553  if (((Vds/Vdsat)!=0))
12554  {
12555  temp = pow((Vds/Vdsat),AX_i);
12556  }
12557  else
12558  {
12559  temp = 0;
12560  }
12561  Vdse = (Vds*pow((1.0+temp),(-inv_AX)));
12562  Udse = (Vdse*inv_phit1);
12563  xn_d = (xn_s+Udse);
12564  if ((Udse<4.6051701859880916e+02))
12565  {
12566  k_ds = exp((-Udse));
12567  }
12568  else
12569  {
12570  k_ds = (1.0e-200/(1.0+((Udse-4.6051701859880916e+02)*(1.0+(0.5*((Udse-4.6051701859880916e+02)*(1.0+((Udse-4.6051701859880916e+02)*3.3333333333333333e-01))))))));
12571  }
12572  delta_nd = (delta_ns*k_ds);
12573  if ((fabs(xg)<=margin))
12574  {
12575  SP_S_temp1 = (((inv_xi*inv_xi)*1.6666666666666667e-01)*7.0710678118654746e-01);
12576  x_d = ((xg*inv_xi)*(1.0+(((xg*(1.0-delta_nd))*Gf)*SP_S_temp1)));
12577  }
12578  else
12579  {
12580  SP_S_bx = (xn_d+3);
12581  SP_S_eta = ((0.5*((SP_S_x1+SP_S_bx)-sqrt((((SP_S_x1-SP_S_bx)*(SP_S_x1-SP_S_bx))+5.0))))-(0.5*(SP_S_bx-sqrt(((SP_S_bx*SP_S_bx)+5.0)))));
12582  SP_S_temp = (xg-SP_S_eta);
12583  SP_S_temp1 = exp((-SP_S_eta));
12584  SP_S_temp2 = (1.0/(2.0+(SP_S_eta*SP_S_eta)));
12585  SP_S_xi0 = ((SP_S_eta*SP_S_eta)*SP_S_temp2);
12586  SP_S_xi1 = (4.0*((SP_S_eta*SP_S_temp2)*SP_S_temp2));
12587  SP_S_xi2 = ((((8.0*SP_S_temp2)-(12.0*SP_S_xi0))*SP_S_temp2)*SP_S_temp2);
12588  SP_S_a = max(1.0e-40,((SP_S_temp*SP_S_temp)-(Gf2*(((SP_S_temp1+SP_S_eta)-1.0)-(delta_nd*((SP_S_eta+1.0)+SP_S_xi0))))));
12589  SP_S_b = (1.0-(0.5*(Gf2*(SP_S_temp1-(delta_nd*SP_S_xi2)))));
12590  SP_S_c = ((2.0*SP_S_temp)+(Gf2*((1.0-SP_S_temp1)-(delta_nd*(1.0+SP_S_xi1)))));
12591  SP_S_tau = ((xn_d-SP_S_eta)+log((SP_S_a/Gf2)));
12592  nu = (SP_S_a+SP_S_c);
12593  mutau = ((nu*nu)+(SP_S_tau*((0.5*(SP_S_c*SP_S_c))-(SP_S_a*SP_S_b))));
12594  SP_S_x0 = (SP_S_eta+(((SP_S_a*nu)*SP_S_tau)/(mutau+(((((nu/mutau)*SP_S_tau)*SP_S_tau)*SP_S_c)*(((SP_S_c*SP_S_c)*3.3333333333333333e-01)-(SP_S_a*SP_S_b))))));
12595  if ((SP_S_x0<2.3025850929940458e+02))
12596  {
12597  SP_S_delta0 = exp(SP_S_x0);
12598  SP_S_delta1 = (1.0/SP_S_delta0);
12599  SP_S_delta0 = (delta_nd*SP_S_delta0);
12600  }
12601  else
12602  {
12603  if ((SP_S_x0>(xn_d-2.3025850929940458e+02)))
12604  {
12605  SP_S_delta0 = exp((SP_S_x0-xn_d));
12606  SP_S_delta1 = (delta_nd/SP_S_delta0);
12607  }
12608  else
12609  {
12610  SP_S_delta0 = (1.0e-100/(1.0+(((xn_d-SP_S_x0)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_d-SP_S_x0)-2.3025850929940458e+02)*(1.0+(((xn_d-SP_S_x0)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12611  SP_S_delta1 = (1.0e-100/(1.0+((SP_S_x0-2.3025850929940458e+02)*(1.0+(0.5*((SP_S_x0-2.3025850929940458e+02)*(1.0+((SP_S_x0-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12612  }
12613  }
12614  SP_S_temp = (1.0/(2.0+(SP_S_x0*SP_S_x0)));
12615  SP_S_xi0 = ((SP_S_x0*SP_S_x0)*SP_S_temp);
12616  SP_S_xi1 = (4.0*((SP_S_x0*SP_S_temp)*SP_S_temp));
12617  SP_S_xi2 = ((((8.0*SP_S_temp)-(12.0*SP_S_xi0))*SP_S_temp)*SP_S_temp);
12618  SP_S_temp = (xg-SP_S_x0);
12619  SP_S_pC = ((2.0*SP_S_temp)+(Gf2*(((1.0-SP_S_delta1)+SP_S_delta0)-(delta_nd*(1.0+SP_S_xi1)))));
12620  SP_S_qC = ((SP_S_temp*SP_S_temp)-(Gf2*((((SP_S_delta1+SP_S_x0)-1.0)+SP_S_delta0)-(delta_nd*((SP_S_x0+1.0)+SP_S_xi0)))));
12621  SP_S_temp = (2.0-(Gf2*((SP_S_delta1+SP_S_delta0)-(delta_nd*SP_S_xi2))));
12622  SP_S_temp = ((SP_S_pC*SP_S_pC)-(2.0*(SP_S_qC*SP_S_temp)));
12623  x_d = (SP_S_x0+(2.0*(SP_S_qC/(SP_S_pC+sqrt(SP_S_temp)))));
12624  }
12625  x_ds = (x_d-x_s);
12626  if ((x_ds<1.0E-10))
12627  {
12628  pC = ((2.0*(xg-x_s))+(Gf2*(((1.0-Es)+(delta_1s*k_ds))-(delta_nd*(1.0+xi1s)))));
12629  qC = ((Gf2*(1.0-k_ds))*Ds);
12630  temp = (2.0-(Gf2*((Es+(delta_1s*k_ds))-(delta_nd*xi2s))));
12631  temp = ((pC*pC)-(2.0*(temp*qC)));
12632  x_ds = (2.0*(qC/(pC+sqrt(temp))));
12633  x_d = (x_s+x_ds);
12634  }
12635  dps = (x_ds*phit1);
12636  xi0d = ((x_d*x_d)/(2.0+(x_d*x_d)));
12637  if ((x_d<2.3025850929940458e+02))
12638  {
12639  Ed = exp((-x_d));
12640  if ((x_d<1.0e-5))
12641  {
12642  Dd = (((((1.6666666666666667e-01*delta_nd)*x_d)*x_d)*x_d)*(1.0+(1.75*x_d)));
12643  }
12644  else
12645  {
12646  Dd = (delta_nd*((((1.0/Ed)-x_d)-1.0)-xi0d));
12647  }
12648  }
12649  else
12650  {
12651  if ((x_d>(xn_d-2.3025850929940458e+02)))
12652  {
12653  temp = exp((x_d-xn_d));
12654  Ed = (delta_nd/temp);
12655  Dd = (temp-(delta_nd*((x_d+1.0)+xi0d)));
12656  }
12657  else
12658  {
12659  Ed = (1.0e-100/(1.0+((x_d-2.3025850929940458e+02)*(1.0+(0.5*((x_d-2.3025850929940458e+02)*(1.0+((x_d-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12660  temp = (1.0e-100/(1.0+(((xn_d-x_d)-2.3025850929940458e+02)*(1.0+(0.5*(((xn_d-x_d)-2.3025850929940458e+02)*(1.0+(((xn_d-x_d)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
12661  Dd = (temp-(delta_nd*((x_d+1.0)+xi0d)));
12662  }
12663  }
12664  x_m = (0.5*(x_s+x_d));
12665  Em = 0.0;
12666  temp = (Ed*Es);
12667  if ((temp>0.0))
12668  {
12669  Em = sqrt(temp);
12670  }
12671  D_bar = (0.5*(Ds+Dd));
12672  Dm = (D_bar+(0.125*((x_ds*x_ds)*(Em-(2.0*inv_Gf2)))));
12673  if ((x_m<1.0e-5))
12674  {
12675  Pm = (0.5*((x_m*x_m)*(1.0-(3.3333333333333333e-01*(x_m*(1.0-(0.25*x_m)))))));
12676  xgm = (Gf*sqrt((Dm+Pm)));
12677  if ((kp>0.0))
12678  {
12679  eta_p = (1.0/sqrt((1.0+(kp*xgm))));
12680  }
12681  temp = sqrt((1.0-(3.3333333333333333e-01*(x_m*(1.0-(0.25*x_m))))));
12682  sqm = (7.0710678118654746e-01*(x_m*temp));
12683  alpha = (eta_p+(7.0710678118654746e-01*((Gf*((1.0-(0.5*x_m))+(1.6666666666666667e-01*(x_m*x_m))))/temp)));
12684  }
12685  else
12686  {
12687  Pm = ((x_m-1.0)+Em);
12688  xgm = (Gf*sqrt((Dm+Pm)));
12689  if ((kp>0.0))
12690  {
12691  d0 = ((1.0-Em)+(2.0*(xgm*inv_Gf2)));
12692  eta_p = (1.0/sqrt((1.0+(kp*xgm))));
12693  temp = (eta_p/(eta_p+1.0));
12694  x_pm = (kp*(((temp*temp)*Gf2)*Dm));
12695  p_pd = ((2.0*(xgm-x_pm))+(Gf2*((1.0-Em)+Dm)));
12696  q_pd = (x_pm*(x_pm-(2.0*xgm)));
12697  xi_pd = (1.0-(0.5*(Gf2*(Em+Dm))));
12698  u_pd = ((q_pd*p_pd)/((p_pd*p_pd)-(xi_pd*q_pd)));
12699  x_m = (x_m+u_pd);
12700  km = exp(u_pd);
12701  Em = (Em/km);
12702  Dm = (Dm*km);
12703  Pm = ((x_m-1.0)+Em);
12704  xgm = (Gf*sqrt((Dm+Pm)));
12705  help = ((1.0-Em)+(2.0*((xgm*eta_p)*inv_Gf2)));
12706  x_ds = (((x_ds*km)*(d0+D_bar))/(help+(km*D_bar)));
12707  dps = (x_ds*phit1);
12708  }
12709  sqm = sqrt(Pm);
12710  alpha = (eta_p+(0.5*((Gf*(1.0-Em))/sqm)));
12711  }
12712  qim = (phit1*((Gf2*Dm)/(xgm+(Gf*sqm))));
12713  qim1 = (qim+(phit1*alpha));
12714  qbm = ((sqm*Gf)*phit1);
12715  if ((RSG_i<0))
12716  {
12717  temp = (1.0-(RSG_i*qim));
12718  }
12719  else
12720  {
12721  temp = (1.0/(1.0+(RSG_i*qim)));
12722  }
12723  GR = (THER_i*((rhob*temp)*qim));
12724  qeff = (qbm+(eta_mu*qim));
12725  qeff1 = (qbm+(eta_mu1*qim));
12726  Eeffm = (E_eff0*qeff);
12727  if (((Eeffm*MUE_i)!=0))
12728  {
12729  Mutmp = (pow((Eeffm*MUE_i),THEMU_i)+(CS_i*(Pm/((Pm+Dm)+1.0e-14))));
12730  }
12731  else
12732  {
12733  Mutmp = (CS_i*(Pm/((Pm+Dm)+1.0e-14)));
12734  }
12735  Gmob = (((1.0+Mutmp)+GR)*Rxcor);
12736  s1 = log(((1.0+((Vds-dps)*inv_VP))/(1.0+((Vdse-dps)*inv_VP))));
12737  dL = (ALP_i*s1);
12738  GdL = (1.0/((1.0+dL)+(dL*dL)));
12739  temp2 = (qim*xitsb);
12740  wsat = (100.0*(temp2/(100.0+temp2)));
12741  Gmob_dL = (Gmob*GdL);
12742  if ((THESATG_i<0))
12743  {
12744  temp = (1/(1-(THESATG_i*wsat)));
12745  }
12746  else
12747  {
12748  temp = (1+(THESATG_i*wsat));
12749  }
12750  thesat1 = (THESAT_i*(temp/Gmob_dL));
12751  zsat = (((thesat1*thesat1)*dps)*dps);
12752  if (((model_.CHNL_TYPE)==(-1)))
12753  {
12754  zsat = (zsat/(1.0+(thesat1*dps)));
12755  }
12756  Gvsat = (0.5*(Gmob_dL*(1.0+sqrt((1.0+(2.0*zsat))))));
12757  Gvsatinv = (1.0/Gvsat);
12758  Voxm = (xgm*phit1);
12759  temp = (Gmob_dL*Gvsatinv);
12760  alpha1 = (alpha*(1.0+(0.5*((zsat*temp)*temp))));
12761  H = ((temp*qim1)/alpha1);
12762  }
12763  xg_ac = xg;
12764  qeff1_ac = qeff1;
12765  Voxm_ac = Voxm;
12766  alpha_ac = alpha;
12767  dps_ac = dps;
12768  qim_ac = qim;
12769  qim1_ac = qim1;
12770  GdL_ac = GdL;
12771  H_ac = H;
12772  eta_p_ac = eta_p;
12773  Gvsat_ac = Gvsat;
12774  Gmob_dL_ac = Gmob_dL;
12775  x_m_ac = x_m;
12776  Gf_ac = Gf;
12777  }
12778  else
12779  {
12780  xg_ac = xg_dc;
12781  qeff1_ac = qeff1_dc;
12782  Voxm_ac = Voxm_dc;
12783  alpha_ac = alpha_dc;
12784  dps_ac = dps_dc;
12785  qim_ac = qim_dc;
12786  qim1_ac = qim1_dc;
12787  GdL_ac = GdL_dc;
12788  H_ac = H_dc;
12789  eta_p_ac = eta_p_dc;
12790  Gvsat_ac = Gvsat_dc;
12791  Gmob_dL_ac = Gmob_dL_dc;
12792  x_m_ac = x_m_dc;
12793  Gf_ac = Gf_dc;
12794  }
12795  }
12796  // End block SPcalc_ac
12797  Vgb = (Vgs+Vsb);
12798  COX_qm = COX_i;
12799  if ((qq>0.0))
12800  {
12801  COX_qm = (COX_i/(1.0+(qq*pow(((qeff1_ac*qeff1_ac)+qlim2),((-1.0)*1.6666666666666667e-01)))));
12802  }
12803  if ((xg_ac<=0.0))
12804  {
12805  QG = Voxm_ac;
12806  QI = 0.0;
12807  QD = 0.0;
12808  QB = QG;
12809  }
12810  else
12811  {
12812  Fj = (0.5*(dps_ac/H_ac));
12813  Fj2 = (Fj*Fj);
12814  QCLM = ((1.0-GdL_ac)*(qim_ac-(0.5*(alpha_ac*dps_ac))));
12815  QG = (Voxm_ac+(0.5*((eta_p_ac*dps_ac)*((((Fj*GdL_ac)*3.3333333333333333e-01)-1.0)+GdL_ac))));
12816  temp = ((alpha_ac*dps_ac)*1.6666666666666667e-01);
12817  QI = ((GdL_ac*(qim_ac+(temp*Fj)))+QCLM);
12818  QD = (0.5*(((GdL_ac*GdL_ac)*(qim_ac-(temp*((1.0-Fj)-(0.2*Fj2)))))+(QCLM*(1.0+GdL_ac))));
12819  QB = (QG-QI);
12820  }
12821  Qg = (QG*COX_qm);
12822  Qd = ((-QD)*COX_qm);
12823  Qb = ((-QB)*COX_qm);
12824  Qgs_ov = (CGOV_i*Vovs);
12825  Qgd_ov = (CGOVD_i*Vovd);
12826  Qgb_ov = (CGBOV_i*Vgb);
12827  Qfgs = (CFR_i*VgsPrime);
12828  Qfgd = (CFRD_i*VgdPrime);
12829  }
12830  // End block evaluateDynamic
12831  //Begin block evaluateStaticDynamic
12832  {
12833  if (((model_.SWJUNCAP_i)>0))
12834  {
12835  if (((model_.SWJUNEXP_i)==1))
12836  {
12837  tm0 = ((Vjun_s*(model_.phitdinv))*MFOR1_s);
12838  if ((tm0<(-2.3025850929940458e+02)))
12839  {
12840  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12841  }
12842  else
12843  {
12844  if ((tm0>xhighf1_s))
12845  {
12846  tm1 = (expxhf1_s*((tm0-xhighf1_s)+1));
12847  }
12848  else
12849  {
12850  tm1 = exp(tm0);
12851  }
12852  }
12853  ijunfor1 = (ISATFOR1_s*(tm1-1.0));
12854  tm0 = ((Vjun_s*(model_.phitdinv))*MFOR2_s);
12855  if ((tm0<(-2.3025850929940458e+02)))
12856  {
12857  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12858  }
12859  else
12860  {
12861  if ((tm0>xhighf2_s))
12862  {
12863  tm1 = (expxhf2_s*((tm0-xhighf2_s)+1));
12864  }
12865  else
12866  {
12867  tm1 = exp(tm0);
12868  }
12869  }
12870  ijunfor2 = (ISATFOR2_s*(tm1-1.0));
12871  ijunrev = 0.0;
12872  if ((m0flag_s>0))
12873  {
12874  ijunrev = (Vjun_s*(ISATREV_s+(Vjun_s*MREV_s)));
12875  }
12876  else
12877  {
12878  tm0 = (((-Vjun_s)*(model_.phitdinv))*MREV_s);
12879  if ((tm0<(-2.3025850929940458e+02)))
12880  {
12881  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12882  }
12883  else
12884  {
12885  if ((tm0>xhighr_s))
12886  {
12887  tm1 = (expxhr_s*((tm0-xhighr_s)+1));
12888  }
12889  else
12890  {
12891  tm1 = exp(tm0);
12892  }
12893  }
12894  ijunrev = ((-ISATREV_s)*(tm1-1.0));
12895  }
12896  ijun_s = ((ijunfor1+ijunfor2)+ijunrev);
12897  tm0 = ((Vjun_d*(model_.phitdinv))*MFOR1_d);
12898  if ((tm0<(-2.3025850929940458e+02)))
12899  {
12900  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12901  }
12902  else
12903  {
12904  if ((tm0>xhighf1_d))
12905  {
12906  tm1 = (expxhf1_d*((tm0-xhighf1_d)+1));
12907  }
12908  else
12909  {
12910  tm1 = exp(tm0);
12911  }
12912  }
12913  ijunfor1 = (ISATFOR1_d*(tm1-1.0));
12914  tm0 = ((Vjun_d*(model_.phitdinv))*MFOR2_d);
12915  if ((tm0<(-2.3025850929940458e+02)))
12916  {
12917  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12918  }
12919  else
12920  {
12921  if ((tm0>xhighf2_d))
12922  {
12923  tm1 = (expxhf2_d*((tm0-xhighf2_d)+1));
12924  }
12925  else
12926  {
12927  tm1 = exp(tm0);
12928  }
12929  }
12930  ijunfor2 = (ISATFOR2_d*(tm1-1.0));
12931  ijunrev = 0.0;
12932  if ((m0flag_d>0))
12933  {
12934  ijunrev = (Vjun_d*(ISATREV_d+(Vjun_d*MREV_d)));
12935  }
12936  else
12937  {
12938  tm0 = (((-Vjun_d)*(model_.phitdinv))*MREV_d);
12939  if ((tm0<(-2.3025850929940458e+02)))
12940  {
12941  tm1 = (1.0e-100/(((-2.3025850929940458e+02)-tm0)+1));
12942  }
12943  else
12944  {
12945  if ((tm0>xhighr_d))
12946  {
12947  tm1 = (expxhr_d*((tm0-xhighr_d)+1));
12948  }
12949  else
12950  {
12951  tm1 = exp(tm0);
12952  }
12953  }
12954  ijunrev = ((-ISATREV_d)*(tm1-1.0));
12955  }
12956  ijun_d = ((ijunfor1+ijunfor2)+ijunrev);
12957  //Begin block evaluateDynamic
12958  {
12965  (model_.PBOT_i) = (model_.PBOTS_i);
12966  (model_.PSTI_i) = (model_.PSTIS_i);
12967  (model_.PGAT_i) = (model_.PGATS_i);
13001  (model_.FJUNQ_i) = (model_.FJUNQS_i);
13008  (model_.ftdbot) = (model_.ftdbot_s);
13009  (model_.ftdsti) = (model_.ftdsti_s);
13010  (model_.ftdgat) = (model_.ftdgat_s);
13014  (model_.ubibot) = (model_.ubibot_s);
13015  (model_.ubisti) = (model_.ubisti_s);
13016  (model_.ubigat) = (model_.ubigat_s);
13017  (model_.vbibot) = (model_.vbibot_s);
13018  (model_.vbisti) = (model_.vbisti_s);
13019  (model_.vbigat) = (model_.vbigat_s);
13029  (model_.cjobot) = (model_.cjobot_s);
13030  (model_.cjosti) = (model_.cjosti_s);
13031  (model_.cjogat) = (model_.cjogat_s);
13071  h1 = ((4.0*vch_s)*vch_s);
13072  h2 = (vch_s/vfmin_s);
13073  h2d = (Vjun_s+(vch_s*h2));
13074  h3 = (vfmin_s+h2d);
13075  h4 = (vfmin_s-h2d);
13076  h5 = sqrt(((h4*h4)+h1));
13077  vjv = (2.0*((Vjun_s*vfmin_s)/(h3+h5)));
13078  if ((zflagbot_s>0.5))
13079  {
13080  if (((model_.one_minus_PBOT)==0.5))
13081  {
13082  tmpv = sqrt((1-(vjv*(model_.vbiinvbot))));
13083  }
13084  else
13085  {
13086  tmpv = pow((1-(vjv*(model_.vbiinvbot))),(model_.one_minus_PBOT));
13087  }
13088  qjunbot_s = (((model_.qprefbot)*(1-tmpv))+((model_.qpref2bot)*(Vjun_s-vjv)));
13089  }
13090  if ((zflagsti_s>0.5))
13091  {
13092  if (((model_.one_minus_PSTI)==0.5))
13093  {
13094  tmpv = sqrt((1-(vjv*(model_.vbiinvsti))));
13095  }
13096  else
13097  {
13098  tmpv = pow((1-(vjv*(model_.vbiinvsti))),(model_.one_minus_PSTI));
13099  }
13100  qjunsti_s = (((model_.qprefsti)*(1-tmpv))+((model_.qpref2sti)*(Vjun_s-vjv)));
13101  }
13102  if ((zflaggat_s>0.5))
13103  {
13104  if (((model_.one_minus_PGAT)==0.5))
13105  {
13106  tmpv = sqrt((1-(vjv*(model_.vbiinvgat))));
13107  }
13108  else
13109  {
13110  tmpv = pow((1-(vjv*(model_.vbiinvgat))),(model_.one_minus_PGAT));
13111  }
13112  qjungat_s = (((model_.qprefgat)*(1-tmpv))+((model_.qpref2gat)*(Vjun_s-vjv)));
13113  }
13120  (model_.PBOT_i) = (model_.PBOTD_i);
13121  (model_.PSTI_i) = (model_.PSTID_i);
13122  (model_.PGAT_i) = (model_.PGATD_i);
13156  (model_.FJUNQ_i) = (model_.FJUNQD_i);
13163  (model_.ftdbot) = (model_.ftdbot_d);
13164  (model_.ftdsti) = (model_.ftdsti_d);
13165  (model_.ftdgat) = (model_.ftdgat_d);
13169  (model_.ubibot) = (model_.ubibot_d);
13170  (model_.ubisti) = (model_.ubisti_d);
13171  (model_.ubigat) = (model_.ubigat_d);
13172  (model_.vbibot) = (model_.vbibot_d);
13173  (model_.vbisti) = (model_.vbisti_d);
13174  (model_.vbigat) = (model_.vbigat_d);
13184  (model_.cjobot) = (model_.cjobot_d);
13185  (model_.cjosti) = (model_.cjosti_d);
13186  (model_.cjogat) = (model_.cjogat_d);
13226  h1 = ((4.0*vch_d)*vch_d);
13227  h2 = (vch_d/vfmin_d);
13228  h2d = (Vjun_d+(vch_d*h2));
13229  h3 = (vfmin_d+h2d);
13230  h4 = (vfmin_d-h2d);
13231  h5 = sqrt(((h4*h4)+h1));
13232  vjv = (2.0*((Vjun_d*vfmin_d)/(h3+h5)));
13233  if ((zflagbot_d>0.5))
13234  {
13235  if (((model_.one_minus_PBOT)==0.5))
13236  {
13237  tmpv = sqrt((1-(vjv*(model_.vbiinvbot))));
13238  }
13239  else
13240  {
13241  tmpv = pow((1-(vjv*(model_.vbiinvbot))),(model_.one_minus_PBOT));
13242  }
13243  qjunbot_d = (((model_.qprefbot)*(1-tmpv))+((model_.qpref2bot)*(Vjun_d-vjv)));
13244  }
13245  if ((zflagsti_d>0.5))
13246  {
13247  if (((model_.one_minus_PSTI)==0.5))
13248  {
13249  tmpv = sqrt((1-(vjv*(model_.vbiinvsti))));
13250  }
13251  else
13252  {
13253  tmpv = pow((1-(vjv*(model_.vbiinvsti))),(model_.one_minus_PSTI));
13254  }
13255  qjunsti_d = (((model_.qprefsti)*(1-tmpv))+((model_.qpref2sti)*(Vjun_d-vjv)));
13256  }
13257  if ((zflaggat_d>0.5))
13258  {
13259  if (((model_.one_minus_PGAT)==0.5))
13260  {
13261  tmpv = sqrt((1-(vjv*(model_.vbiinvgat))));
13262  }
13263  else
13264  {
13265  tmpv = pow((1-(vjv*(model_.vbiinvgat))),(model_.one_minus_PGAT));
13266  }
13267  qjungat_d = (((model_.qprefgat)*(1-tmpv))+((model_.qpref2gat)*(Vjun_d-vjv)));
13268  }
13269  }
13270  // End block evaluateDynamic
13271  }
13272  else
13273  {
13280  (model_.PBOT_i) = (model_.PBOTS_i);
13281  (model_.PSTI_i) = (model_.PSTIS_i);
13282  (model_.PGAT_i) = (model_.PGATS_i);
13316  (model_.FJUNQ_i) = (model_.FJUNQS_i);
13323  (model_.ftdbot) = (model_.ftdbot_s);
13324  (model_.ftdsti) = (model_.ftdsti_s);
13325  (model_.ftdgat) = (model_.ftdgat_s);
13329  (model_.ubibot) = (model_.ubibot_s);
13330  (model_.ubisti) = (model_.ubisti_s);
13331  (model_.ubigat) = (model_.ubigat_s);
13332  (model_.vbibot) = (model_.vbibot_s);
13333  (model_.vbisti) = (model_.vbisti_s);
13334  (model_.vbigat) = (model_.vbigat_s);
13344  (model_.cjobot) = (model_.cjobot_s);
13345  (model_.cjosti) = (model_.cjosti_s);
13346  (model_.cjogat) = (model_.cjogat_s);
13386  vbbt = 0.0;
13387  two_psistar = 0.0;
13388  if ((!(((ABSOURCE_i==0)&&(LSSOURCE_i==0))&&(LGSOURCE_i==0))))
13389  {
13390  h1 = ((4.0*vch_s)*vch_s);
13391  h2 = (vch_s/vfmin_s);
13392  h2d = (Vjun_s+(vch_s*h2));
13393  h3 = (vfmin_s+h2d);
13394  h4 = (vfmin_s-h2d);
13395  h5 = sqrt(((h4*h4)+h1));
13396  vj = (2.0*((Vjun_s*vfmin_s)/(h3+h5)));
13397  if ((Vjun_s<VMAX_s))
13398  {
13399  if ((fabs((0.5*(Vjun_s*(model_.phitdinv))))<2.3025850929940458e+02))
13400  {
13401  zinv = exp((0.5*(Vjun_s*(model_.phitdinv))));
13402  }
13403  else
13404  {
13405  if (((0.5*(Vjun_s*(model_.phitdinv)))<(-2.3025850929940458e+02)))
13406  {
13407  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(Vjun_s*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(Vjun_s*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(Vjun_s*(model_.phitdinv))))*3.3333333333333333e-01))))))));
13408  }
13409  else
13410  {
13411  zinv = (1.0e100*(1.0+(((0.5*(Vjun_s*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(Vjun_s*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(Vjun_s*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
13412  }
13413  }
13414  idmult = (zinv*zinv);
13415  }
13416  else
13417  {
13418  idmult = ((1+((Vjun_s-VMAX_s)*(model_.phitdinv)))*exp_VMAX_over_phitd_s);
13419  zinv = sqrt(idmult);
13420  }
13421  idmult = (idmult-1.0);
13422  z = (1/zinv);
13423  if ((Vjun_s>0))
13424  {
13425  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
13426  }
13427  else
13428  {
13429  two_psistar = ((-Vjun_s)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
13430  }
13431  vjlim = (vbimin_s-two_psistar);
13432  vjsrh = (0.5*((Vjun_s+vjlim)-sqrt((((Vjun_s-vjlim)*(Vjun_s-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
13433  vbbt = (0.5*((Vjun_s+vbbtlim_s)-sqrt((((Vjun_s-vbbtlim_s)*(Vjun_s-vbbtlim_s))+((4*(model_.phitr))*(model_.phitr))))));
13434  vav = (0.5*((Vjun_s)-sqrt((((Vjun_s)*(Vjun_s))+((4*1E-6)*1E-6)))));
13435  }
13436  if ((ABSOURCE_i==0))
13437  {
13438  ijunbot_s = 0;
13439  qjunbot_s = 0;
13440  }
13441  else
13442  {
13443  if (((model_.one_minus_PBOT)==0.5))
13444  {
13445  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
13446  }
13447  else
13448  {
13449  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
13450  }
13451  qjunbot_s = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(Vjun_s-vj)));
13452  id = ((model_.idsatbot)*idmult);
13453  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
13454  {
13455  isrh = 0;
13456  }
13457  else
13458  {
13460  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
13461  if (((model_.PBOT_i)==0.5))
13462  {
13463  dwsrh = 0;
13464  }
13465  else
13466  {
13467  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
13468  }
13469  wsrh = (wsrhstep+dwsrh);
13470  if (((model_.PBOT_i)==0.5))
13471  {
13472  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
13473  }
13474  else
13475  {
13476  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
13477  }
13478  wdep = ((model_.wdepnulrbot)*tmp);
13479  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
13480  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
13481  }
13482  if (((model_.CTATBOT_i)==0))
13483  {
13484  itat = 0;
13485  }
13486  else
13487  {
13489  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
13490  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
13491  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
13492  sqrtumax = sqrt(fabs(umax));
13493  umaxpoweronepointfive = (umax*sqrtumax);
13494  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
13495  {
13496  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
13497  }
13498  else
13499  {
13500  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
13501  }
13502  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
13503  ktat = sqrt((0.375*(btat/sqrtumax)));
13504  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
13505  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
13506  xerfc = ((ltat-1)*ktat);
13507  ysq = (xerfc*xerfc);
13508  if ((xerfc>0))
13509  {
13510  terfc = (1/(1+((model_.perfc)*xerfc)));
13511  }
13512  else
13513  {
13514  terfc = (1/(1-((model_.perfc)*xerfc)));
13515  }
13516  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
13517  {
13518  tmp = exp(((-ysq)+mtat));
13519  }
13520  else
13521  {
13522  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
13523  }
13524  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
13525  if ((xerfc>0))
13526  {
13527  erfctimesexpmtat = erfcpos;
13528  }
13529  else
13530  {
13531  if ((mtat>(-2.3025850929940458e+02)))
13532  {
13533  tmp = exp(mtat);
13534  }
13535  else
13536  {
13537  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
13538  }
13539  erfctimesexpmtat = ((2*tmp)-erfcpos);
13540  }
13541  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
13542  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
13543  }
13544  if (((model_.CBBTBOT_i)==0))
13545  {
13546  ibbt = 0;
13547  }
13548  else
13549  {
13550  if (((model_.PBOT_i)==0.5))
13551  {
13552  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
13553  }
13554  else
13555  {
13556  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
13557  }
13558  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
13559  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
13560  {
13561  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
13562  }
13563  else
13564  {
13565  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
13566  {
13567  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
13568  }
13569  else
13570  {
13571  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
13572  }
13573  }
13574  ibbt = ((model_.CBBTBOT_i)*(((Vjun_s*Fmaxr)*Fmaxr)*tmp));
13575  }
13576  if (((model_.VBRBOT_i)>1000))
13577  {
13578  fbreakdown = 1;
13579  }
13580  else
13581  {
13582  if ((vav>((-0.999)*(model_.VBRBOT_i))))
13583  {
13584  if (((model_.PBRBOT_i)==4))
13585  {
13586  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
13587  }
13588  else
13589  {
13590  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
13591  }
13592  fbreakdown = (1/(1-tmp));
13593  }
13594  else
13595  {
13596  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
13597  }
13598  }
13599  ijunbot_s = ((((id+isrh)+itat)+ibbt)*fbreakdown);
13600  }
13601  if ((LSSOURCE_i==0))
13602  {
13603  ijunsti_s = 0;
13604  qjunsti_s = 0;
13605  }
13606  else
13607  {
13608  if (((model_.one_minus_PSTI)==0.5))
13609  {
13610  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
13611  }
13612  else
13613  {
13614  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
13615  }
13616  qjunsti_s = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(Vjun_s-vj)));
13617  id = ((model_.idsatsti)*idmult);
13618  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
13619  {
13620  isrh = 0;
13621  }
13622  else
13623  {
13625  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
13626  if (((model_.PSTI_i)==0.5))
13627  {
13628  dwsrh = 0;
13629  }
13630  else
13631  {
13632  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
13633  }
13634  wsrh = (wsrhstep+dwsrh);
13635  if (((model_.PSTI_i)==0.5))
13636  {
13637  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
13638  }
13639  else
13640  {
13641  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
13642  }
13643  wdep = ((model_.wdepnulrsti)*tmp);
13644  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
13645  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
13646  }
13647  if (((model_.CTATSTI_i)==0))
13648  {
13649  itat = 0;
13650  }
13651  else
13652  {
13654  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
13655  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
13656  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
13657  sqrtumax = sqrt(fabs(umax));
13658  umaxpoweronepointfive = (umax*sqrtumax);
13659  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
13660  {
13661  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
13662  }
13663  else
13664  {
13665  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
13666  }
13667  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
13668  ktat = sqrt((0.375*(btat/sqrtumax)));
13669  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
13670  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
13671  xerfc = ((ltat-1)*ktat);
13672  ysq = (xerfc*xerfc);
13673  if ((xerfc>0))
13674  {
13675  terfc = (1/(1+((model_.perfc)*xerfc)));
13676  }
13677  else
13678  {
13679  terfc = (1/(1-((model_.perfc)*xerfc)));
13680  }
13681  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
13682  {
13683  tmp = exp(((-ysq)+mtat));
13684  }
13685  else
13686  {
13687  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
13688  }
13689  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
13690  if ((xerfc>0))
13691  {
13692  erfctimesexpmtat = erfcpos;
13693  }
13694  else
13695  {
13696  if ((mtat>(-2.3025850929940458e+02)))
13697  {
13698  tmp = exp(mtat);
13699  }
13700  else
13701  {
13702  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
13703  }
13704  erfctimesexpmtat = ((2*tmp)-erfcpos);
13705  }
13706  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
13707  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
13708  }
13709  if (((model_.CBBTSTI_i)==0))
13710  {
13711  ibbt = 0;
13712  }
13713  else
13714  {
13715  if (((model_.PSTI_i)==0.5))
13716  {
13717  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
13718  }
13719  else
13720  {
13721  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
13722  }
13723  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
13724  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
13725  {
13726  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
13727  }
13728  else
13729  {
13730  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
13731  {
13732  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
13733  }
13734  else
13735  {
13736  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
13737  }
13738  }
13739  ibbt = ((model_.CBBTSTI_i)*(((Vjun_s*Fmaxr)*Fmaxr)*tmp));
13740  }
13741  if (((model_.VBRSTI_i)>1000))
13742  {
13743  fbreakdown = 1;
13744  }
13745  else
13746  {
13747  if ((vav>((-0.999)*(model_.VBRSTI_i))))
13748  {
13749  if (((model_.PBRSTI_i)==4))
13750  {
13751  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
13752  }
13753  else
13754  {
13755  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
13756  }
13757  fbreakdown = (1/(1-tmp));
13758  }
13759  else
13760  {
13761  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
13762  }
13763  }
13764  ijunsti_s = ((((id+isrh)+itat)+ibbt)*fbreakdown);
13765  }
13766  if ((LGSOURCE_i==0))
13767  {
13768  ijungat_s = 0;
13769  qjungat_s = 0;
13770  }
13771  else
13772  {
13773  if (((model_.one_minus_PGAT)==0.5))
13774  {
13775  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
13776  }
13777  else
13778  {
13779  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
13780  }
13781  qjungat_s = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(Vjun_s-vj)));
13782  id = ((model_.idsatgat)*idmult);
13783  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
13784  {
13785  isrh = 0;
13786  }
13787  else
13788  {
13790  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
13791  if (((model_.PGAT_i)==0.5))
13792  {
13793  dwsrh = 0;
13794  }
13795  else
13796  {
13797  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
13798  }
13799  wsrh = (wsrhstep+dwsrh);
13800  if (((model_.PGAT_i)==0.5))
13801  {
13802  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
13803  }
13804  else
13805  {
13806  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
13807  }
13808  wdep = ((model_.wdepnulrgat)*tmp);
13809  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
13810  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
13811  }
13812  if (((model_.CTATGAT_i)==0))
13813  {
13814  itat = 0;
13815  }
13816  else
13817  {
13819  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
13820  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
13821  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
13822  sqrtumax = sqrt(fabs(umax));
13823  umaxpoweronepointfive = (umax*sqrtumax);
13824  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
13825  {
13826  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
13827  }
13828  else
13829  {
13830  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
13831  }
13832  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
13833  ktat = sqrt((0.375*(btat/sqrtumax)));
13834  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
13835  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
13836  xerfc = ((ltat-1)*ktat);
13837  ysq = (xerfc*xerfc);
13838  if ((xerfc>0))
13839  {
13840  terfc = (1/(1+((model_.perfc)*xerfc)));
13841  }
13842  else
13843  {
13844  terfc = (1/(1-((model_.perfc)*xerfc)));
13845  }
13846  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
13847  {
13848  tmp = exp(((-ysq)+mtat));
13849  }
13850  else
13851  {
13852  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
13853  }
13854  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
13855  if ((xerfc>0))
13856  {
13857  erfctimesexpmtat = erfcpos;
13858  }
13859  else
13860  {
13861  if ((mtat>(-2.3025850929940458e+02)))
13862  {
13863  tmp = exp(mtat);
13864  }
13865  else
13866  {
13867  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
13868  }
13869  erfctimesexpmtat = ((2*tmp)-erfcpos);
13870  }
13871  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
13872  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
13873  }
13874  if (((model_.CBBTGAT_i)==0))
13875  {
13876  ibbt = 0;
13877  }
13878  else
13879  {
13880  if (((model_.PGAT_i)==0.5))
13881  {
13882  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
13883  }
13884  else
13885  {
13886  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
13887  }
13888  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
13889  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
13890  {
13891  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
13892  }
13893  else
13894  {
13895  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
13896  {
13897  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
13898  }
13899  else
13900  {
13901  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
13902  }
13903  }
13904  ibbt = ((model_.CBBTGAT_i)*(((Vjun_s*Fmaxr)*Fmaxr)*tmp));
13905  }
13906  if (((model_.VBRGAT_i)>1000))
13907  {
13908  fbreakdown = 1;
13909  }
13910  else
13911  {
13912  if ((vav>((-0.999)*(model_.VBRGAT_i))))
13913  {
13914  if (((model_.PBRGAT_i)==4))
13915  {
13916  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
13917  }
13918  else
13919  {
13920  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
13921  }
13922  fbreakdown = (1/(1-tmp));
13923  }
13924  else
13925  {
13926  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
13927  }
13928  }
13929  ijungat_s = ((((id+isrh)+itat)+ibbt)*fbreakdown);
13930  }
13938  (model_.PBOT_i) = (model_.PBOTD_i);
13939  (model_.PSTI_i) = (model_.PSTID_i);
13940  (model_.PGAT_i) = (model_.PGATD_i);
13974  (model_.FJUNQ_i) = (model_.FJUNQD_i);
13981  (model_.ftdbot) = (model_.ftdbot_d);
13982  (model_.ftdsti) = (model_.ftdsti_d);
13983  (model_.ftdgat) = (model_.ftdgat_d);
13987  (model_.ubibot) = (model_.ubibot_d);
13988  (model_.ubisti) = (model_.ubisti_d);
13989  (model_.ubigat) = (model_.ubigat_d);
13990  (model_.vbibot) = (model_.vbibot_d);
13991  (model_.vbisti) = (model_.vbisti_d);
13992  (model_.vbigat) = (model_.vbigat_d);
14002  (model_.cjobot) = (model_.cjobot_d);
14003  (model_.cjosti) = (model_.cjosti_d);
14004  (model_.cjogat) = (model_.cjogat_d);
14044  vbbt = 0.0;
14045  two_psistar = 0.0;
14046  if ((!(((ABDRAIN_i==0)&&(LSDRAIN_i==0))&&(LGDRAIN_i==0))))
14047  {
14048  h1 = ((4.0*vch_d)*vch_d);
14049  h2 = (vch_d/vfmin_d);
14050  h2d = (Vjun_d+(vch_d*h2));
14051  h3 = (vfmin_d+h2d);
14052  h4 = (vfmin_d-h2d);
14053  h5 = sqrt(((h4*h4)+h1));
14054  vj = (2.0*((Vjun_d*vfmin_d)/(h3+h5)));
14055  if ((Vjun_d<VMAX_d))
14056  {
14057  if ((fabs((0.5*(Vjun_d*(model_.phitdinv))))<2.3025850929940458e+02))
14058  {
14059  zinv = exp((0.5*(Vjun_d*(model_.phitdinv))));
14060  }
14061  else
14062  {
14063  if (((0.5*(Vjun_d*(model_.phitdinv)))<(-2.3025850929940458e+02)))
14064  {
14065  zinv = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-(0.5*(Vjun_d*(model_.phitdinv))))*(1.0+(0.5*(((-2.3025850929940458e+02)-(0.5*(Vjun_d*(model_.phitdinv))))*(1.0+(((-2.3025850929940458e+02)-(0.5*(Vjun_d*(model_.phitdinv))))*3.3333333333333333e-01))))))));
14066  }
14067  else
14068  {
14069  zinv = (1.0e100*(1.0+(((0.5*(Vjun_d*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(0.5*(((0.5*(Vjun_d*(model_.phitdinv)))-2.3025850929940458e+02)*(1.0+(((0.5*(Vjun_d*(model_.phitdinv)))-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
14070  }
14071  }
14072  idmult = (zinv*zinv);
14073  }
14074  else
14075  {
14076  idmult = ((1+((Vjun_d-VMAX_d)*(model_.phitdinv)))*exp_VMAX_over_phitd_d);
14077  zinv = sqrt(idmult);
14078  }
14079  idmult = (idmult-1.0);
14080  z = (1/zinv);
14081  if ((Vjun_d>0))
14082  {
14083  two_psistar = (2.0*((model_.phitd)*log(((2.0+z)+sqrt(((z+1.0)*(z+3.0)))))));
14084  }
14085  else
14086  {
14087  two_psistar = ((-Vjun_d)+(2.0*((model_.phitd)*log((((2*zinv)+1)+sqrt(((1+zinv)*(1+(3*zinv)))))))));
14088  }
14089  vjlim = (vbimin_d-two_psistar);
14090  vjsrh = (0.5*((Vjun_d+vjlim)-sqrt((((Vjun_d-vjlim)*(Vjun_d-vjlim))+((4*(model_.phitd))*(model_.phitd))))));
14091  vbbt = (0.5*((Vjun_d+vbbtlim_d)-sqrt((((Vjun_d-vbbtlim_d)*(Vjun_d-vbbtlim_d))+((4*(model_.phitr))*(model_.phitr))))));
14092  vav = (0.5*((Vjun_d)-sqrt((((Vjun_d)*(Vjun_d))+((4*1E-6)*1E-6)))));
14093  }
14094  if ((ABDRAIN_i==0))
14095  {
14096  ijunbot_d = 0;
14097  qjunbot_d = 0;
14098  }
14099  else
14100  {
14101  if (((model_.one_minus_PBOT)==0.5))
14102  {
14103  tmp = sqrt((1-(vj*(model_.vbiinvbot))));
14104  }
14105  else
14106  {
14107  tmp = pow((1-(vj*(model_.vbiinvbot))),(model_.one_minus_PBOT));
14108  }
14109  qjunbot_d = (((model_.qprefbot)*(1-tmp))+((model_.qpref2bot)*(Vjun_d-vj)));
14110  id = ((model_.idsatbot)*idmult);
14111  if ((((model_.CSRHBOT_i)==0)&&((model_.CTATBOT_i)==0)))
14112  {
14113  isrh = 0;
14114  }
14115  else
14116  {
14118  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
14119  if (((model_.PBOT_i)==0.5))
14120  {
14121  dwsrh = 0;
14122  }
14123  else
14124  {
14125  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PBOT_i))));
14126  }
14127  wsrh = (wsrhstep+dwsrh);
14128  if (((model_.PBOT_i)==0.5))
14129  {
14130  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRBOTinv)));
14131  }
14132  else
14133  {
14134  tmp = pow((vbi_minus_vjsrh*(model_.VBIRBOTinv)),(model_.PBOT_i));
14135  }
14136  wdep = ((model_.wdepnulrbot)*tmp);
14137  asrh = ((model_.ftdbot)*((zinv-1)*wdep));
14138  isrh = ((model_.CSRHBOT_i)*(asrh*wsrh));
14139  }
14140  if (((model_.CTATBOT_i)==0))
14141  {
14142  itat = 0;
14143  }
14144  else
14145  {
14147  twoatatoverthreebtat = ((0.666666666666667*(model_.atatbot))/btat);
14148  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
14149  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
14150  sqrtumax = sqrt(fabs(umax));
14151  umaxpoweronepointfive = (umax*sqrtumax);
14152  if ((((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT))==(-1)))
14153  {
14154  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
14155  }
14156  else
14157  {
14158  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PBOT_i))*(model_.one_over_one_minus_PBOT)));
14159  }
14160  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
14161  ktat = sqrt((0.375*(btat/sqrtumax)));
14162  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
14163  mtat = (((((model_.atatbot)*twoatatoverthreebtat)*sqrtumax)-((model_.atatbot)*umax))+(0.5*(btat*umaxpoweronepointfive)));
14164  xerfc = ((ltat-1)*ktat);
14165  ysq = (xerfc*xerfc);
14166  if ((xerfc>0))
14167  {
14168  terfc = (1/(1+((model_.perfc)*xerfc)));
14169  }
14170  else
14171  {
14172  terfc = (1/(1-((model_.perfc)*xerfc)));
14173  }
14174  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
14175  {
14176  tmp = exp(((-ysq)+mtat));
14177  }
14178  else
14179  {
14180  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
14181  }
14182  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
14183  if ((xerfc>0))
14184  {
14185  erfctimesexpmtat = erfcpos;
14186  }
14187  else
14188  {
14189  if ((mtat>(-2.3025850929940458e+02)))
14190  {
14191  tmp = exp(mtat);
14192  }
14193  else
14194  {
14195  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
14196  }
14197  erfctimesexpmtat = ((2*tmp)-erfcpos);
14198  }
14199  gammamax = ((1.77245385090551603*0.5)*(((model_.atatbot)*erfctimesexpmtat)/ktat));
14200  itat = ((model_.CTATBOT_i)*((asrh*gammamax)*wtat));
14201  }
14202  if (((model_.CBBTBOT_i)==0))
14203  {
14204  ibbt = 0;
14205  }
14206  else
14207  {
14208  if (((model_.PBOT_i)==0.5))
14209  {
14210  tmp = sqrt((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)));
14211  }
14212  else
14213  {
14214  tmp = pow((((model_.VBIRBOT_i)-vbbt)*(model_.VBIRBOTinv)),(model_.PBOT_i));
14215  }
14216  Fmaxr = ((model_.one_over_one_minus_PBOT)*((((model_.VBIRBOT_i)-vbbt)*(model_.wdepnulrinvbot))/tmp));
14217  if ((fabs(((-(model_.fbbtbot))/Fmaxr))<2.3025850929940458e+02))
14218  {
14219  tmp = exp(((-(model_.fbbtbot))/Fmaxr));
14220  }
14221  else
14222  {
14223  if ((((-(model_.fbbtbot))/Fmaxr)<(-2.3025850929940458e+02)))
14224  {
14225  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtbot))/Fmaxr))*3.3333333333333333e-01))))))));
14226  }
14227  else
14228  {
14229  tmp = (1.0e100*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtbot))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
14230  }
14231  }
14232  ibbt = ((model_.CBBTBOT_i)*(((Vjun_d*Fmaxr)*Fmaxr)*tmp));
14233  }
14234  if (((model_.VBRBOT_i)>1000))
14235  {
14236  fbreakdown = 1;
14237  }
14238  else
14239  {
14240  if ((vav>((-0.999)*(model_.VBRBOT_i))))
14241  {
14242  if (((model_.PBRBOT_i)==4))
14243  {
14244  tmp = (((fabs((vav*(model_.VBRinvbot)))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))))*fabs((vav*(model_.VBRinvbot))));
14245  }
14246  else
14247  {
14248  tmp = pow(fabs((vav*(model_.VBRinvbot))),(model_.PBRBOT_i));
14249  }
14250  fbreakdown = (1/(1-tmp));
14251  }
14252  else
14253  {
14254  fbreakdown = ((model_.fstopbot)+((vav+(0.999*(model_.VBRBOT_i)))*(model_.slopebot)));
14255  }
14256  }
14257  ijunbot_d = ((((id+isrh)+itat)+ibbt)*fbreakdown);
14258  }
14259  if ((LSDRAIN_i==0))
14260  {
14261  ijunsti_d = 0;
14262  qjunsti_d = 0;
14263  }
14264  else
14265  {
14266  if (((model_.one_minus_PSTI)==0.5))
14267  {
14268  tmp = sqrt((1-(vj*(model_.vbiinvsti))));
14269  }
14270  else
14271  {
14272  tmp = pow((1-(vj*(model_.vbiinvsti))),(model_.one_minus_PSTI));
14273  }
14274  qjunsti_d = (((model_.qprefsti)*(1-tmp))+((model_.qpref2sti)*(Vjun_d-vj)));
14275  id = ((model_.idsatsti)*idmult);
14276  if ((((model_.CSRHSTI_i)==0)&&((model_.CTATSTI_i)==0)))
14277  {
14278  isrh = 0;
14279  }
14280  else
14281  {
14283  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
14284  if (((model_.PSTI_i)==0.5))
14285  {
14286  dwsrh = 0;
14287  }
14288  else
14289  {
14290  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PSTI_i))));
14291  }
14292  wsrh = (wsrhstep+dwsrh);
14293  if (((model_.PSTI_i)==0.5))
14294  {
14295  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRSTIinv)));
14296  }
14297  else
14298  {
14299  tmp = pow((vbi_minus_vjsrh*(model_.VBIRSTIinv)),(model_.PSTI_i));
14300  }
14301  wdep = ((model_.wdepnulrsti)*tmp);
14302  asrh = ((model_.ftdsti)*((zinv-1)*wdep));
14303  isrh = ((model_.CSRHSTI_i)*(asrh*wsrh));
14304  }
14305  if (((model_.CTATSTI_i)==0))
14306  {
14307  itat = 0;
14308  }
14309  else
14310  {
14312  twoatatoverthreebtat = ((0.666666666666667*(model_.atatsti))/btat);
14313  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
14314  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
14315  sqrtumax = sqrt(fabs(umax));
14316  umaxpoweronepointfive = (umax*sqrtumax);
14317  if ((((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI))==(-1)))
14318  {
14319  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
14320  }
14321  else
14322  {
14323  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PSTI_i))*(model_.one_over_one_minus_PSTI)));
14324  }
14325  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
14326  ktat = sqrt((0.375*(btat/sqrtumax)));
14327  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
14328  mtat = (((((model_.atatsti)*twoatatoverthreebtat)*sqrtumax)-((model_.atatsti)*umax))+(0.5*(btat*umaxpoweronepointfive)));
14329  xerfc = ((ltat-1)*ktat);
14330  ysq = (xerfc*xerfc);
14331  if ((xerfc>0))
14332  {
14333  terfc = (1/(1+((model_.perfc)*xerfc)));
14334  }
14335  else
14336  {
14337  terfc = (1/(1-((model_.perfc)*xerfc)));
14338  }
14339  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
14340  {
14341  tmp = exp(((-ysq)+mtat));
14342  }
14343  else
14344  {
14345  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
14346  }
14347  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
14348  if ((xerfc>0))
14349  {
14350  erfctimesexpmtat = erfcpos;
14351  }
14352  else
14353  {
14354  if ((mtat>(-2.3025850929940458e+02)))
14355  {
14356  tmp = exp(mtat);
14357  }
14358  else
14359  {
14360  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
14361  }
14362  erfctimesexpmtat = ((2*tmp)-erfcpos);
14363  }
14364  gammamax = ((1.77245385090551603*0.5)*(((model_.atatsti)*erfctimesexpmtat)/ktat));
14365  itat = ((model_.CTATSTI_i)*((asrh*gammamax)*wtat));
14366  }
14367  if (((model_.CBBTSTI_i)==0))
14368  {
14369  ibbt = 0;
14370  }
14371  else
14372  {
14373  if (((model_.PSTI_i)==0.5))
14374  {
14375  tmp = sqrt((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)));
14376  }
14377  else
14378  {
14379  tmp = pow((((model_.VBIRSTI_i)-vbbt)*(model_.VBIRSTIinv)),(model_.PSTI_i));
14380  }
14381  Fmaxr = ((model_.one_over_one_minus_PSTI)*((((model_.VBIRSTI_i)-vbbt)*(model_.wdepnulrinvsti))/tmp));
14382  if ((fabs(((-(model_.fbbtsti))/Fmaxr))<2.3025850929940458e+02))
14383  {
14384  tmp = exp(((-(model_.fbbtsti))/Fmaxr));
14385  }
14386  else
14387  {
14388  if ((((-(model_.fbbtsti))/Fmaxr)<(-2.3025850929940458e+02)))
14389  {
14390  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtsti))/Fmaxr))*3.3333333333333333e-01))))))));
14391  }
14392  else
14393  {
14394  tmp = (1.0e100*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtsti))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
14395  }
14396  }
14397  ibbt = ((model_.CBBTSTI_i)*(((Vjun_d*Fmaxr)*Fmaxr)*tmp));
14398  }
14399  if (((model_.VBRSTI_i)>1000))
14400  {
14401  fbreakdown = 1;
14402  }
14403  else
14404  {
14405  if ((vav>((-0.999)*(model_.VBRSTI_i))))
14406  {
14407  if (((model_.PBRSTI_i)==4))
14408  {
14409  tmp = (((fabs((vav*(model_.VBRinvsti)))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))))*fabs((vav*(model_.VBRinvsti))));
14410  }
14411  else
14412  {
14413  tmp = pow(fabs((vav*(model_.VBRinvsti))),(model_.PBRSTI_i));
14414  }
14415  fbreakdown = (1/(1-tmp));
14416  }
14417  else
14418  {
14419  fbreakdown = ((model_.fstopsti)+((vav+(0.999*(model_.VBRSTI_i)))*(model_.slopesti)));
14420  }
14421  }
14422  ijunsti_d = ((((id+isrh)+itat)+ibbt)*fbreakdown);
14423  }
14424  if ((LGDRAIN_i==0))
14425  {
14426  ijungat_d = 0;
14427  qjungat_d = 0;
14428  }
14429  else
14430  {
14431  if (((model_.one_minus_PGAT)==0.5))
14432  {
14433  tmp = sqrt((1-(vj*(model_.vbiinvgat))));
14434  }
14435  else
14436  {
14437  tmp = pow((1-(vj*(model_.vbiinvgat))),(model_.one_minus_PGAT));
14438  }
14439  qjungat_d = (((model_.qprefgat)*(1-tmp))+((model_.qpref2gat)*(Vjun_d-vj)));
14440  id = ((model_.idsatgat)*idmult);
14441  if ((((model_.CSRHGAT_i)==0)&&((model_.CTATGAT_i)==0)))
14442  {
14443  isrh = 0;
14444  }
14445  else
14446  {
14448  wsrhstep = (1-sqrt((1-(two_psistar/vbi_minus_vjsrh))));
14449  if (((model_.PGAT_i)==0.5))
14450  {
14451  dwsrh = 0;
14452  }
14453  else
14454  {
14455  dwsrh = (((((wsrhstep*wsrhstep)*log(wsrhstep))/(1-wsrhstep))+wsrhstep)*(1-(2*(model_.PGAT_i))));
14456  }
14457  wsrh = (wsrhstep+dwsrh);
14458  if (((model_.PGAT_i)==0.5))
14459  {
14460  tmp = sqrt((vbi_minus_vjsrh*(model_.VBIRGATinv)));
14461  }
14462  else
14463  {
14464  tmp = pow((vbi_minus_vjsrh*(model_.VBIRGATinv)),(model_.PGAT_i));
14465  }
14466  wdep = ((model_.wdepnulrgat)*tmp);
14467  asrh = ((model_.ftdgat)*((zinv-1)*wdep));
14468  isrh = ((model_.CSRHGAT_i)*(asrh*wsrh));
14469  }
14470  if (((model_.CTATGAT_i)==0))
14471  {
14472  itat = 0;
14473  }
14474  else
14475  {
14477  twoatatoverthreebtat = ((0.666666666666667*(model_.atatgat))/btat);
14478  umaxbeforelimiting = (twoatatoverthreebtat*twoatatoverthreebtat);
14479  umax = sqrt(((umaxbeforelimiting*umaxbeforelimiting)/((umaxbeforelimiting*umaxbeforelimiting)+1)));
14480  sqrtumax = sqrt(fabs(umax));
14481  umaxpoweronepointfive = (umax*sqrtumax);
14482  if ((((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT))==(-1)))
14483  {
14484  wgamma = (1/(1+(btat*umaxpoweronepointfive)));
14485  }
14486  else
14487  {
14488  wgamma = pow((1+(btat*umaxpoweronepointfive)),((-(model_.PGAT_i))*(model_.one_over_one_minus_PGAT)));
14489  }
14490  wtat = ((wsrh*wgamma)/(wsrh+wgamma));
14491  ktat = sqrt((0.375*(btat/sqrtumax)));
14492  ltat = ((2*(twoatatoverthreebtat*sqrtumax))-umax);
14493  mtat = (((((model_.atatgat)*twoatatoverthreebtat)*sqrtumax)-((model_.atatgat)*umax))+(0.5*(btat*umaxpoweronepointfive)));
14494  xerfc = ((ltat-1)*ktat);
14495  ysq = (xerfc*xerfc);
14496  if ((xerfc>0))
14497  {
14498  terfc = (1/(1+((model_.perfc)*xerfc)));
14499  }
14500  else
14501  {
14502  terfc = (1/(1-((model_.perfc)*xerfc)));
14503  }
14504  if ((((-ysq)+mtat)>(-2.3025850929940458e+02)))
14505  {
14506  tmp = exp(((-ysq)+mtat));
14507  }
14508  else
14509  {
14510  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-ysq)+mtat))*(1.0+(((-2.3025850929940458e+02)-((-ysq)+mtat))*3.3333333333333333e-01))))))));
14511  }
14512  erfcpos = ((((0.29214664*terfc)+((model_.berfc)*(terfc*terfc)))+((model_.cerfc)*((terfc*terfc)*terfc)))*tmp);
14513  if ((xerfc>0))
14514  {
14515  erfctimesexpmtat = erfcpos;
14516  }
14517  else
14518  {
14519  if ((mtat>(-2.3025850929940458e+02)))
14520  {
14521  tmp = exp(mtat);
14522  }
14523  else
14524  {
14525  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-mtat)*(1.0+(0.5*(((-2.3025850929940458e+02)-mtat)*(1.0+(((-2.3025850929940458e+02)-mtat)*3.3333333333333333e-01))))))));
14526  }
14527  erfctimesexpmtat = ((2*tmp)-erfcpos);
14528  }
14529  gammamax = ((1.77245385090551603*0.5)*(((model_.atatgat)*erfctimesexpmtat)/ktat));
14530  itat = ((model_.CTATGAT_i)*((asrh*gammamax)*wtat));
14531  }
14532  if (((model_.CBBTGAT_i)==0))
14533  {
14534  ibbt = 0;
14535  }
14536  else
14537  {
14538  if (((model_.PGAT_i)==0.5))
14539  {
14540  tmp = sqrt((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)));
14541  }
14542  else
14543  {
14544  tmp = pow((((model_.VBIRGAT_i)-vbbt)*(model_.VBIRGATinv)),(model_.PGAT_i));
14545  }
14546  Fmaxr = ((model_.one_over_one_minus_PGAT)*((((model_.VBIRGAT_i)-vbbt)*(model_.wdepnulrinvgat))/tmp));
14547  if ((fabs(((-(model_.fbbtgat))/Fmaxr))<2.3025850929940458e+02))
14548  {
14549  tmp = exp(((-(model_.fbbtgat))/Fmaxr));
14550  }
14551  else
14552  {
14553  if ((((-(model_.fbbtgat))/Fmaxr)<(-2.3025850929940458e+02)))
14554  {
14555  tmp = (1.0e-100/(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(0.5*(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*(1.0+(((-2.3025850929940458e+02)-((-(model_.fbbtgat))/Fmaxr))*3.3333333333333333e-01))))))));
14556  }
14557  else
14558  {
14559  tmp = (1.0e100*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+(0.5*((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*(1.0+((((-(model_.fbbtgat))/Fmaxr)-2.3025850929940458e+02)*3.3333333333333333e-01))))))));
14560  }
14561  }
14562  ibbt = ((model_.CBBTGAT_i)*(((Vjun_d*Fmaxr)*Fmaxr)*tmp));
14563  }
14564  if (((model_.VBRGAT_i)>1000))
14565  {
14566  fbreakdown = 1;
14567  }
14568  else
14569  {
14570  if ((vav>((-0.999)*(model_.VBRGAT_i))))
14571  {
14572  if (((model_.PBRGAT_i)==4))
14573  {
14574  tmp = (((fabs((vav*(model_.VBRinvgat)))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))))*fabs((vav*(model_.VBRinvgat))));
14575  }
14576  else
14577  {
14578  tmp = pow(fabs((vav*(model_.VBRinvgat))),(model_.PBRGAT_i));
14579  }
14580  fbreakdown = (1/(1-tmp));
14581  }
14582  else
14583  {
14584  fbreakdown = ((model_.fstopgat)+((vav+(0.999*(model_.VBRGAT_i)))*(model_.slopegat)));
14585  }
14586  }
14587  ijungat_d = ((((id+isrh)+itat)+ibbt)*fbreakdown);
14588  }
14590  }
14591  }
14592  }
14593  // End block evaluateStaticDynamic
14594  //Begin block loadStatic
14595  {
14596  Idse = (MULT_i*Ids);
14597  Igbe = (MULT_i*Igb);
14598  Igcse = (MULT_i*Igcs);
14599  Igcde = (MULT_i*Igcd);
14600  Igsove = (MULT_i*Igsov);
14601  Igdove = (MULT_i*Igdov);
14602  Igidle = (MULT_i*Igidl);
14603  Igisle = (MULT_i*Igisl);
14604  Iimpacte = (MULT_i*Iimpact);
14605  ijun_s = (MULT_i*ijun_s);
14606  ijun_d = (MULT_i*ijun_d);
14607  if ((sigVds>0))
14608  {
14609  // I(DI,BP) <+ ((CHNL_TYPE*Iimpacte))
14612  // I(DI,SI) <+ ((CHNL_TYPE*Idse))
14615  // I(GP,SI) <+ ((CHNL_TYPE*Igcse))
14618  // I(GP,DI) <+ ((CHNL_TYPE*Igcde))
14621  }
14622  else
14623  {
14624  // I(SI,BP) <+ ((CHNL_TYPE*Iimpacte))
14627  // I(SI,DI) <+ ((CHNL_TYPE*Idse))
14630  // I(GP,DI) <+ ((CHNL_TYPE*Igcse))
14633  // I(GP,SI) <+ ((CHNL_TYPE*Igcde))
14636  }
14637  // I(GP,BP) <+ ((CHNL_TYPE*Igbe))
14640  // I(GP,SI) <+ ((CHNL_TYPE*Igsove))
14643  // I(GP,DI) <+ ((CHNL_TYPE*Igdove))
14646  // I(SI,BP) <+ ((CHNL_TYPE*Igisle))
14649  // I(DI,BP) <+ ((CHNL_TYPE*Igidle))
14652  // I(BS,SI) <+ ((CHNL_TYPE*ijun_s))
14655  // I(BD,DI) <+ ((CHNL_TYPE*ijun_d))
14658  rgatenoise = (((model_.nt0)*MULT_i)*ggate);
14659  rsourcenoise = (((model_.nt0)*MULT_i)*gsource);
14660  rdrainnoise = (((model_.nt0)*MULT_i)*gdrain);
14661  rbulknoise = (((model_.nt0)*MULT_i)*gbulk);
14662  rjunsnoise = (((model_.nt0)*MULT_i)*gjuns);
14663  rjundnoise = (((model_.nt0)*MULT_i)*gjund);
14664  rwellnoise = (((model_.nt0)*MULT_i)*gwell);
14665  if ((RG_i>0.0))
14666  {
14667  // I(G,GP) <+ (((MULT_i*ggate)*V(G,GP)))
14669  staticContributions[admsNodeID_GP] -= ((MULT_i*ggate)*(probeVars[admsProbeID_V_G_GP]));
14670  // I(G,GP) <+ (white_noise(rgatenoise,"rgate"))
14671  }
14672  else
14673  {
14674  // V(G,GP) <+ (0.0)
14675  // do nothing at all
14676  }
14677  if ((RSE_i>0.0))
14678  {
14679  // I(S,SI) <+ (((MULT_i*gsource)*V(S,SI)))
14681  staticContributions[admsNodeID_SI] -= ((MULT_i*gsource)*(probeVars[admsProbeID_V_S_SI]));
14682  // I(S,SI) <+ (white_noise(rsourcenoise,"rsource"))
14683  }
14684  else
14685  {
14686  // V(S,SI) <+ (0.0)
14687  // do nothing at all
14688  }
14689  if ((RDE_i>0.0))
14690  {
14691  // I(D,DI) <+ (((MULT_i*gdrain)*V(D,DI)))
14693  staticContributions[admsNodeID_DI] -= ((MULT_i*gdrain)*(probeVars[admsProbeID_V_D_DI]));
14694  // I(D,DI) <+ (white_noise(rdrainnoise,"rdrain"))
14695  }
14696  else
14697  {
14698  // V(D,DI) <+ (0.0)
14699  // do nothing at all
14700  }
14701  if ((RBULK_i>0.0))
14702  {
14703  // I(BP,BI) <+ (((MULT_i*gbulk)*V(BP,BI)))
14705  staticContributions[admsNodeID_BI] -= ((MULT_i*gbulk)*(probeVars[admsProbeID_V_BP_BI]));
14706  // I(BP,BI) <+ (white_noise(rbulknoise,"rbulk"))
14707  }
14708  else
14709  {
14710  // V(BP,BI) <+ (0.0)
14711  // do nothing at all
14712  }
14713  if ((RJUNS_i>0.0))
14714  {
14715  // I(BS,BI) <+ (((MULT_i*gjuns)*V(BS,BI)))
14717  staticContributions[admsNodeID_BI] -= ((MULT_i*gjuns)*(probeVars[admsProbeID_V_BS_BI]));
14718  // I(BS,BI) <+ (white_noise(rjunsnoise,"rjuns"))
14719  }
14720  else
14721  {
14722  // V(BS,BI) <+ (0.0)
14723  // do nothing at all
14724  }
14725  if ((RJUND_i>0.0))
14726  {
14727  // I(BD,BI) <+ (((MULT_i*gjund)*V(BD,BI)))
14729  staticContributions[admsNodeID_BI] -= ((MULT_i*gjund)*(probeVars[admsProbeID_V_BD_BI]));
14730  // I(BD,BI) <+ (white_noise(rjundnoise,"rjund"))
14731  }
14732  else
14733  {
14734  // V(BD,BI) <+ (0.0)
14735  // do nothing at all
14736  }
14737  if ((RWELL_i>0.0))
14738  {
14739  // I(B,BI) <+ (((MULT_i*gwell)*V(B,BI)))
14741  staticContributions[admsNodeID_BI] -= ((MULT_i*gwell)*(probeVars[admsProbeID_V_B_BI]));
14742  // I(B,BI) <+ (white_noise(rwellnoise,"rwell"))
14743  }
14744  else
14745  {
14746  // V(B,BI) <+ (0.0)
14747  // do nothing at all
14748  }
14749  // I(DI,SI) <+ ((1E-15*V(DI,SI)))
14752  }
14753  // End block loadStatic
14754  //Begin block loadDynamic
14755  {
14756  Qg = (MULT_i*Qg);
14757  Qb = (MULT_i*Qb);
14758  Qd = (MULT_i*Qd);
14759  Qs = (-((Qg+Qb)+Qd));
14760  Qfgs = (MULT_i*(Qfgs+Qgs_ov));
14761  Qfgd = (MULT_i*(Qfgd+Qgd_ov));
14762  Qgb_ov = (MULT_i*Qgb_ov);
14765  if ((sigVds<0))
14766  {
14767  temp = Qd;
14768  Qd = Qs;
14769  Qs = temp;
14770  }
14771  // I(GP,SI) <+ (ddt((CHNL_TYPE*Qg)))
14774  // I(BP,SI) <+ (ddt((CHNL_TYPE*Qb)))
14777  // I(DI,SI) <+ (ddt((CHNL_TYPE*Qd)))
14780  // I(GP,SI) <+ (ddt((CHNL_TYPE*Qfgs)))
14783  // I(GP,DI) <+ (ddt((CHNL_TYPE*Qfgd)))
14786  // I(GP,BP) <+ (ddt((CHNL_TYPE*Qgb_ov)))
14789  // I(BS,SI) <+ (ddt((CHNL_TYPE*qjun_s)))
14792  // I(BD,DI) <+ (ddt((CHNL_TYPE*qjun_d)))
14795  }
14796  // End block loadDynamic
14797 
14798 
14799  // -- endcode converted from analog/code block
14800 #ifdef Xyce_DEBUG_DEVICE
14802  {
14803  Xyce::dout() << " probeVars[admsProbeID_V_DI_BD] = "
14804  <<probeVars[admsProbeID_V_DI_BD].val() << std::endl;
14805  Xyce::dout() << " probeVars[admsProbeID_V_SI_BS] = "
14806  <<probeVars[admsProbeID_V_SI_BS].val() << std::endl;
14807  Xyce::dout() << " probeVars[admsProbeID_V_SI_BP] = "
14808  <<probeVars[admsProbeID_V_SI_BP].val() << std::endl;
14809  Xyce::dout() << " probeVars[admsProbeID_V_DI_SI] = "
14810  <<probeVars[admsProbeID_V_DI_SI].val() << std::endl;
14811  Xyce::dout() << " probeVars[admsProbeID_V_GP_SI] = "
14812  <<probeVars[admsProbeID_V_GP_SI].val() << std::endl;
14813  Xyce::dout() << " probeVars[admsProbeID_V_B_BI] = "
14814  <<probeVars[admsProbeID_V_B_BI].val() << std::endl;
14815  Xyce::dout() << " probeVars[admsProbeID_V_BP_BI] = "
14816  <<probeVars[admsProbeID_V_BP_BI].val() << std::endl;
14817  Xyce::dout() << " probeVars[admsProbeID_V_BD_BI] = "
14818  <<probeVars[admsProbeID_V_BD_BI].val() << std::endl;
14819  Xyce::dout() << " probeVars[admsProbeID_V_BS_BI] = "
14820  <<probeVars[admsProbeID_V_BS_BI].val() << std::endl;
14821  Xyce::dout() << " probeVars[admsProbeID_V_D_DI] = "
14822  <<probeVars[admsProbeID_V_D_DI].val() << std::endl;
14823  Xyce::dout() << " probeVars[admsProbeID_V_S_SI] = "
14824  <<probeVars[admsProbeID_V_S_SI].val() << std::endl;
14825  Xyce::dout() << " probeVars[admsProbeID_V_G_GP] = "
14826  <<probeVars[admsProbeID_V_G_GP].val() << std::endl;
14827  Xyce::dout() << " staticContributions[admsNodeID_D] = "
14828  <<staticContributions[admsNodeID_D].val() << std::endl;
14829  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_DI_BD) << std::endl;
14830  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_SI_BS) << std::endl;
14831  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_SI_BP) << std::endl;
14832  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_DI_SI) << std::endl;
14833  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_GP_SI) << std::endl;
14834  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_B_BI) << std::endl;
14835  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_BP_BI) << std::endl;
14836  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_BD_BI) << std::endl;
14837  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_BS_BI) << std::endl;
14838  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI) << std::endl;
14839  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_S_SI) << std::endl;
14840  Xyce::dout() << " staticContributions[admsNodeID_D].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_D].dx(admsProbeID_V_G_GP) << std::endl;
14841  Xyce::dout() << " dynamicContributions[admsNodeID_D] = "
14842  <<dynamicContributions[admsNodeID_D].val() << std::endl;
14843  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_DI_BD) << std::endl;
14844  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_SI_BS) << std::endl;
14845  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_SI_BP) << std::endl;
14846  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_DI_SI) << std::endl;
14847  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_GP_SI) << std::endl;
14848  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_B_BI) << std::endl;
14849  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BP_BI) << std::endl;
14850  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BD_BI) << std::endl;
14851  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_BS_BI) << std::endl;
14852  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_D_DI) << std::endl;
14853  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_S_SI) << std::endl;
14854  Xyce::dout() << " dynamicContributions[admsNodeID_D].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_D].dx(admsProbeID_V_G_GP) << std::endl;
14855  Xyce::dout() << " staticContributions[admsNodeID_G] = "
14856  <<staticContributions[admsNodeID_G].val() << std::endl;
14857  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_DI_BD) << std::endl;
14858  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_SI_BS) << std::endl;
14859  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_SI_BP) << std::endl;
14860  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_DI_SI) << std::endl;
14861  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_GP_SI) << std::endl;
14862  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_B_BI) << std::endl;
14863  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_BP_BI) << std::endl;
14864  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_BD_BI) << std::endl;
14865  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_BS_BI) << std::endl;
14866  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_D_DI) << std::endl;
14867  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_S_SI) << std::endl;
14868  Xyce::dout() << " staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP) << std::endl;
14869  Xyce::dout() << " dynamicContributions[admsNodeID_G] = "
14870  <<dynamicContributions[admsNodeID_G].val() << std::endl;
14871  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_DI_BD) << std::endl;
14872  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_SI_BS) << std::endl;
14873  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_SI_BP) << std::endl;
14874  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_DI_SI) << std::endl;
14875  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_GP_SI) << std::endl;
14876  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_B_BI) << std::endl;
14877  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BP_BI) << std::endl;
14878  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BD_BI) << std::endl;
14879  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_BS_BI) << std::endl;
14880  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_D_DI) << std::endl;
14881  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_S_SI) << std::endl;
14882  Xyce::dout() << " dynamicContributions[admsNodeID_G].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_G].dx(admsProbeID_V_G_GP) << std::endl;
14883  Xyce::dout() << " staticContributions[admsNodeID_S] = "
14884  <<staticContributions[admsNodeID_S].val() << std::endl;
14885  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_DI_BD) << std::endl;
14886  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_SI_BS) << std::endl;
14887  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_SI_BP) << std::endl;
14888  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_DI_SI) << std::endl;
14889  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_GP_SI) << std::endl;
14890  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_B_BI) << std::endl;
14891  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_BP_BI) << std::endl;
14892  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_BD_BI) << std::endl;
14893  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_BS_BI) << std::endl;
14894  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_D_DI) << std::endl;
14895  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI) << std::endl;
14896  Xyce::dout() << " staticContributions[admsNodeID_S].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_S].dx(admsProbeID_V_G_GP) << std::endl;
14897  Xyce::dout() << " dynamicContributions[admsNodeID_S] = "
14898  <<dynamicContributions[admsNodeID_S].val() << std::endl;
14899  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_DI_BD) << std::endl;
14900  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_SI_BS) << std::endl;
14901  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_SI_BP) << std::endl;
14902  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_DI_SI) << std::endl;
14903  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_GP_SI) << std::endl;
14904  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_B_BI) << std::endl;
14905  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BP_BI) << std::endl;
14906  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BD_BI) << std::endl;
14907  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_BS_BI) << std::endl;
14908  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_D_DI) << std::endl;
14909  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_S_SI) << std::endl;
14910  Xyce::dout() << " dynamicContributions[admsNodeID_S].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_S].dx(admsProbeID_V_G_GP) << std::endl;
14911  Xyce::dout() << " staticContributions[admsNodeID_B] = "
14912  <<staticContributions[admsNodeID_B].val() << std::endl;
14913  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_DI_BD) << std::endl;
14914  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_SI_BS) << std::endl;
14915  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_SI_BP) << std::endl;
14916  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_DI_SI) << std::endl;
14917  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_GP_SI) << std::endl;
14918  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI) << std::endl;
14919  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_BP_BI) << std::endl;
14920  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_BD_BI) << std::endl;
14921  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_BS_BI) << std::endl;
14922  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_D_DI) << std::endl;
14923  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_S_SI) << std::endl;
14924  Xyce::dout() << " staticContributions[admsNodeID_B].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_B].dx(admsProbeID_V_G_GP) << std::endl;
14925  Xyce::dout() << " dynamicContributions[admsNodeID_B] = "
14926  <<dynamicContributions[admsNodeID_B].val() << std::endl;
14927  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_DI_BD) << std::endl;
14928  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_SI_BS) << std::endl;
14929  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_SI_BP) << std::endl;
14930  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_DI_SI) << std::endl;
14931  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_GP_SI) << std::endl;
14932  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_B_BI) << std::endl;
14933  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BP_BI) << std::endl;
14934  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BD_BI) << std::endl;
14935  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_BS_BI) << std::endl;
14936  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_D_DI) << std::endl;
14937  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_S_SI) << std::endl;
14938  Xyce::dout() << " dynamicContributions[admsNodeID_B].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_B].dx(admsProbeID_V_G_GP) << std::endl;
14939  Xyce::dout() << " staticContributions[admsNodeID_GP] = "
14940  <<staticContributions[admsNodeID_GP].val() << std::endl;
14941  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_BD) << std::endl;
14942  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BS) << std::endl;
14943  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP) << std::endl;
14944  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI) << std::endl;
14945  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI) << std::endl;
14946  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_B_BI) << std::endl;
14947  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_BP_BI) << std::endl;
14948  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_BD_BI) << std::endl;
14949  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_BS_BI) << std::endl;
14950  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_D_DI) << std::endl;
14951  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_S_SI) << std::endl;
14952  Xyce::dout() << " staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) << std::endl;
14953  Xyce::dout() << " dynamicContributions[admsNodeID_GP] = "
14954  <<dynamicContributions[admsNodeID_GP].val() << std::endl;
14955  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_BD) << std::endl;
14956  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BS) << std::endl;
14957  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP) << std::endl;
14958  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI) << std::endl;
14959  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI) << std::endl;
14960  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_B_BI) << std::endl;
14961  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BP_BI) << std::endl;
14962  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BD_BI) << std::endl;
14963  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_BS_BI) << std::endl;
14964  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_D_DI) << std::endl;
14965  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_S_SI) << std::endl;
14966  Xyce::dout() << " dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) << std::endl;
14967  Xyce::dout() << " staticContributions[admsNodeID_SI] = "
14968  <<staticContributions[admsNodeID_SI].val() << std::endl;
14969  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) << std::endl;
14970  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS) << std::endl;
14971  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP) << std::endl;
14972  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI) << std::endl;
14973  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI) << std::endl;
14974  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_B_BI) << std::endl;
14975  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_BP_BI) << std::endl;
14976  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_BD_BI) << std::endl;
14977  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_BS_BI) << std::endl;
14978  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_D_DI) << std::endl;
14979  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI) << std::endl;
14980  Xyce::dout() << " staticContributions[admsNodeID_SI].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_SI].dx(admsProbeID_V_G_GP) << std::endl;
14981  Xyce::dout() << " dynamicContributions[admsNodeID_SI] = "
14982  <<dynamicContributions[admsNodeID_SI].val() << std::endl;
14983  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) << std::endl;
14984  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS) << std::endl;
14985  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP) << std::endl;
14986  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI) << std::endl;
14987  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI) << std::endl;
14988  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_B_BI) << std::endl;
14989  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BP_BI) << std::endl;
14990  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BD_BI) << std::endl;
14991  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_BS_BI) << std::endl;
14992  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_D_DI) << std::endl;
14993  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI) << std::endl;
14994  Xyce::dout() << " dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_G_GP) << std::endl;
14995  Xyce::dout() << " staticContributions[admsNodeID_DI] = "
14996  <<staticContributions[admsNodeID_DI].val() << std::endl;
14997  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) << std::endl;
14998  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS) << std::endl;
14999  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP) << std::endl;
15000  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI) << std::endl;
15001  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI) << std::endl;
15002  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_B_BI) << std::endl;
15003  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_BP_BI) << std::endl;
15004  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_BD_BI) << std::endl;
15005  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_BS_BI) << std::endl;
15006  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI) << std::endl;
15007  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_S_SI) << std::endl;
15008  Xyce::dout() << " staticContributions[admsNodeID_DI].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_DI].dx(admsProbeID_V_G_GP) << std::endl;
15009  Xyce::dout() << " dynamicContributions[admsNodeID_DI] = "
15010  <<dynamicContributions[admsNodeID_DI].val() << std::endl;
15011  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) << std::endl;
15012  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS) << std::endl;
15013  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP) << std::endl;
15014  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI) << std::endl;
15015  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI) << std::endl;
15016  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_B_BI) << std::endl;
15017  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BP_BI) << std::endl;
15018  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BD_BI) << std::endl;
15019  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_BS_BI) << std::endl;
15020  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI) << std::endl;
15021  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_S_SI) << std::endl;
15022  Xyce::dout() << " dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_G_GP) << std::endl;
15023  Xyce::dout() << " staticContributions[admsNodeID_BI] = "
15024  <<staticContributions[admsNodeID_BI].val() << std::endl;
15025  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_DI_BD) << std::endl;
15026  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BS) << std::endl;
15027  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BP) << std::endl;
15028  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_DI_SI) << std::endl;
15029  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_GP_SI) << std::endl;
15030  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI) << std::endl;
15031  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI) << std::endl;
15032  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI) << std::endl;
15033  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI) << std::endl;
15034  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_D_DI) << std::endl;
15035  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_S_SI) << std::endl;
15036  Xyce::dout() << " staticContributions[admsNodeID_BI].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_BI].dx(admsProbeID_V_G_GP) << std::endl;
15037  Xyce::dout() << " dynamicContributions[admsNodeID_BI] = "
15038  <<dynamicContributions[admsNodeID_BI].val() << std::endl;
15039  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_DI_BD) << std::endl;
15040  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BS) << std::endl;
15041  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_SI_BP) << std::endl;
15042  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_DI_SI) << std::endl;
15043  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_GP_SI) << std::endl;
15044  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI) << std::endl;
15045  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI) << std::endl;
15046  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI) << std::endl;
15047  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI) << std::endl;
15048  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_D_DI) << std::endl;
15049  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_S_SI) << std::endl;
15050  Xyce::dout() << " dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_BI].dx(admsProbeID_V_G_GP) << std::endl;
15051  Xyce::dout() << " staticContributions[admsNodeID_BP] = "
15052  <<staticContributions[admsNodeID_BP].val() << std::endl;
15053  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_BD) << std::endl;
15054  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BS) << std::endl;
15055  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP) << std::endl;
15056  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI) << std::endl;
15057  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI) << std::endl;
15058  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_B_BI) << std::endl;
15059  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) << std::endl;
15060  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_BD_BI) << std::endl;
15061  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_BS_BI) << std::endl;
15062  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_D_DI) << std::endl;
15063  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_S_SI) << std::endl;
15064  Xyce::dout() << " staticContributions[admsNodeID_BP].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_BP].dx(admsProbeID_V_G_GP) << std::endl;
15065  Xyce::dout() << " dynamicContributions[admsNodeID_BP] = "
15066  <<dynamicContributions[admsNodeID_BP].val() << std::endl;
15067  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_BD) << std::endl;
15068  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BS) << std::endl;
15069  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP) << std::endl;
15070  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI) << std::endl;
15071  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI) << std::endl;
15072  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_B_BI) << std::endl;
15073  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) << std::endl;
15074  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BD_BI) << std::endl;
15075  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_BS_BI) << std::endl;
15076  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_D_DI) << std::endl;
15077  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_S_SI) << std::endl;
15078  Xyce::dout() << " dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_G_GP) << std::endl;
15079  Xyce::dout() << " staticContributions[admsNodeID_BS] = "
15080  <<staticContributions[admsNodeID_BS].val() << std::endl;
15081  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD) << std::endl;
15082  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS) << std::endl;
15083  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BP) << std::endl;
15084  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_SI) << std::endl;
15085  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_GP_SI) << std::endl;
15086  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_B_BI) << std::endl;
15087  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_BP_BI) << std::endl;
15088  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_BD_BI) << std::endl;
15089  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) << std::endl;
15090  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_D_DI) << std::endl;
15091  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_S_SI) << std::endl;
15092  Xyce::dout() << " staticContributions[admsNodeID_BS].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_BS].dx(admsProbeID_V_G_GP) << std::endl;
15093  Xyce::dout() << " dynamicContributions[admsNodeID_BS] = "
15094  <<dynamicContributions[admsNodeID_BS].val() << std::endl;
15095  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD) << std::endl;
15096  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS) << std::endl;
15097  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BP) << std::endl;
15098  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_SI) << std::endl;
15099  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_GP_SI) << std::endl;
15100  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_B_BI) << std::endl;
15101  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BP_BI) << std::endl;
15102  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BD_BI) << std::endl;
15103  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) << std::endl;
15104  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_D_DI) << std::endl;
15105  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_S_SI) << std::endl;
15106  Xyce::dout() << " dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_G_GP) << std::endl;
15107  Xyce::dout() << " staticContributions[admsNodeID_BD] = "
15108  <<staticContributions[admsNodeID_BD].val() << std::endl;
15109  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD) << std::endl;
15110  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS) << std::endl;
15111  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BP) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BP) << std::endl;
15112  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_SI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_SI) << std::endl;
15113  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_GP_SI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_GP_SI) << std::endl;
15114  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_B_BI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_B_BI) << std::endl;
15115  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_BP_BI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_BP_BI) << std::endl;
15116  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) << std::endl;
15117  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_BS_BI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_BS_BI) << std::endl;
15118  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_D_DI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_D_DI) << std::endl;
15119  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_S_SI) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_S_SI) << std::endl;
15120  Xyce::dout() << " staticContributions[admsNodeID_BD].dx(admsProbeID_V_G_GP) = " <<staticContributions[admsNodeID_BD].dx(admsProbeID_V_G_GP) << std::endl;
15121  Xyce::dout() << " dynamicContributions[admsNodeID_BD] = "
15122  <<dynamicContributions[admsNodeID_BD].val() << std::endl;
15123  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD) << std::endl;
15124  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS) << std::endl;
15125  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BP) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BP) << std::endl;
15126  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_SI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_SI) << std::endl;
15127  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_GP_SI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_GP_SI) << std::endl;
15128  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_B_BI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_B_BI) << std::endl;
15129  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BP_BI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BP_BI) << std::endl;
15130  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) << std::endl;
15131  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BS_BI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_BS_BI) << std::endl;
15132  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_D_DI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_D_DI) << std::endl;
15133  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_S_SI) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_S_SI) << std::endl;
15134  Xyce::dout() << " dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_G_GP) = " <<dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_G_GP) << std::endl;
15135 
15136  if (!origFlag)
15137  Xyce::dout() << "This step was limited by this device." << std::endl;
15138  }
15139 #endif // Xyce_DEBUG_DEVICE
15140  return true;
15141 }
15142 
15143 //-----------------------------------------------------------------------------
15144 // Function : Instance::loadDAEdFdx
15145 // Purpose :
15146 // Special Notes : Load the dFdx ("static jacobian") matrix
15147 // Scope : public
15148 // Creator : admsXml
15149 // Creation Date :
15150 //-----------------------------------------------------------------------------
15152 {
15153  bool bsuccess = true;
15154  N_LAS_Matrix * dFdxMatPtr = extData.dFdxMatrixPtr;
15155 
15156 #ifdef Xyce_DEBUG_DEVICE
15157  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15158  {
15159  Xyce::dout() << subsection_divider << std::endl;
15160  Xyce::dout() << "ADMSPSP103VA::Instance::loadDAEdFdx (" << getName() << "):" << std::endl;
15161  }
15162 #endif
15164 
15165 
15166 #ifdef Xyce_DEBUG_DEVICE
15167  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15168  {
15170  }
15171 #endif
15172  (*f_DI_Equ_BP_Node_Ptr) += -staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP);
15173 
15174 
15175 #ifdef Xyce_DEBUG_DEVICE
15176  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15177  {
15178  Xyce::dout() << " (*f_DI_Equ_BP_Node_Ptr) += " << -staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP)<< std::endl;
15179  }
15180 #endif
15182 
15183 
15184 #ifdef Xyce_DEBUG_DEVICE
15185  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15186  {
15188  }
15189 #endif
15191 
15192 
15193 #ifdef Xyce_DEBUG_DEVICE
15194  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15195  {
15196  Xyce::dout() << " (*f_BP_Equ_BP_Node_Ptr) += " << +staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI) -staticContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP)<< std::endl;
15197  }
15198 #endif
15199  (*f_DI_Equ_GP_Node_Ptr) += +staticContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI);
15200 
15201 
15202 #ifdef Xyce_DEBUG_DEVICE
15203  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15204  {
15205  Xyce::dout() << " (*f_DI_Equ_GP_Node_Ptr) += " << +staticContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI)<< std::endl;
15206  }
15207 #endif
15208  (*f_BP_Equ_GP_Node_Ptr) += +staticContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI);
15209 
15210 
15211 #ifdef Xyce_DEBUG_DEVICE
15212  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15213  {
15214  Xyce::dout() << " (*f_BP_Equ_GP_Node_Ptr) += " << +staticContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI)<< std::endl;
15215  }
15216 #endif
15218 
15219 
15220 #ifdef Xyce_DEBUG_DEVICE
15221  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15222  {
15224  }
15225 #endif
15226  (*f_BP_Equ_DI_Node_Ptr) += +staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI);
15227 
15228 
15229 #ifdef Xyce_DEBUG_DEVICE
15230  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15231  {
15232  Xyce::dout() << " (*f_BP_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI)<< std::endl;
15233  }
15234 #endif
15236 
15237 
15238 #ifdef Xyce_DEBUG_DEVICE
15239  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15240  {
15242  }
15243 #endif
15244  (*f_SI_Equ_BP_Node_Ptr) += -staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP);
15245 
15246 
15247 #ifdef Xyce_DEBUG_DEVICE
15248  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15249  {
15250  Xyce::dout() << " (*f_SI_Equ_BP_Node_Ptr) += " << -staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP)<< std::endl;
15251  }
15252 #endif
15253  (*f_SI_Equ_GP_Node_Ptr) += +staticContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI);
15254 
15255 
15256 #ifdef Xyce_DEBUG_DEVICE
15257  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15258  {
15259  Xyce::dout() << " (*f_SI_Equ_GP_Node_Ptr) += " << +staticContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI)<< std::endl;
15260  }
15261 #endif
15263 
15264 
15265 #ifdef Xyce_DEBUG_DEVICE
15266  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15267  {
15268  Xyce::dout() << " (*f_SI_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) +staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI)<< std::endl;
15269  }
15270 #endif
15272 
15273 
15274 #ifdef Xyce_DEBUG_DEVICE
15275  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15276  {
15278  }
15279 #endif
15280  (*f_GP_Equ_BP_Node_Ptr) += -staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP);
15281 
15282 
15283 #ifdef Xyce_DEBUG_DEVICE
15284  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15285  {
15286  Xyce::dout() << " (*f_GP_Equ_BP_Node_Ptr) += " << -staticContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP)<< std::endl;
15287  }
15288 #endif
15289  (*f_GP_Equ_DI_Node_Ptr) += +staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI);
15290 
15291 
15292 #ifdef Xyce_DEBUG_DEVICE
15293  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15294  {
15295  Xyce::dout() << " (*f_GP_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI)<< std::endl;
15296  }
15297 #endif
15299 
15300 
15301 #ifdef Xyce_DEBUG_DEVICE
15302  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15303  {
15304  Xyce::dout() << " (*f_GP_Equ_GP_Node_Ptr) += " << -staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP) +staticContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI)<< std::endl;
15305  }
15306 #endif
15307  (*f_BS_Equ_SI_Node_Ptr) += +staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS);
15308 
15309 
15310 #ifdef Xyce_DEBUG_DEVICE
15311  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15312  {
15313  Xyce::dout() << " (*f_BS_Equ_SI_Node_Ptr) += " << +staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS)<< std::endl;
15314  }
15315 #endif
15317 
15318 
15319 #ifdef Xyce_DEBUG_DEVICE
15320  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15321  {
15322  Xyce::dout() << " (*f_BS_Equ_BS_Node_Ptr) += " << +staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI) -staticContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS)<< std::endl;
15323  }
15324 #endif
15325  (*f_SI_Equ_BS_Node_Ptr) += -staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS);
15326 
15327 
15328 #ifdef Xyce_DEBUG_DEVICE
15329  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15330  {
15331  Xyce::dout() << " (*f_SI_Equ_BS_Node_Ptr) += " << -staticContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS)<< std::endl;
15332  }
15333 #endif
15334  (*f_BS_Equ_DI_Node_Ptr) += +staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD);
15335 
15336 
15337 #ifdef Xyce_DEBUG_DEVICE
15338  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15339  {
15340  Xyce::dout() << " (*f_BS_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD)<< std::endl;
15341  }
15342 #endif
15343  (*f_BS_Equ_BD_Node_Ptr) += -staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD);
15344 
15345 
15346 #ifdef Xyce_DEBUG_DEVICE
15347  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15348  {
15349  Xyce::dout() << " (*f_BS_Equ_BD_Node_Ptr) += " << -staticContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD)<< std::endl;
15350  }
15351 #endif
15352  (*f_SI_Equ_BD_Node_Ptr) += -staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD);
15353 
15354 
15355 #ifdef Xyce_DEBUG_DEVICE
15356  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15357  {
15358  Xyce::dout() << " (*f_SI_Equ_BD_Node_Ptr) += " << -staticContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD)<< std::endl;
15359  }
15360 #endif
15361  (*f_BD_Equ_SI_Node_Ptr) += +staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS);
15362 
15363 
15364 #ifdef Xyce_DEBUG_DEVICE
15365  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15366  {
15367  Xyce::dout() << " (*f_BD_Equ_SI_Node_Ptr) += " << +staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS)<< std::endl;
15368  }
15369 #endif
15370  (*f_BD_Equ_BS_Node_Ptr) += -staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS);
15371 
15372 
15373 #ifdef Xyce_DEBUG_DEVICE
15374  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15375  {
15376  Xyce::dout() << " (*f_BD_Equ_BS_Node_Ptr) += " << -staticContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS)<< std::endl;
15377  }
15378 #endif
15379  (*f_DI_Equ_BS_Node_Ptr) += -staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS);
15380 
15381 
15382 #ifdef Xyce_DEBUG_DEVICE
15383  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15384  {
15385  Xyce::dout() << " (*f_DI_Equ_BS_Node_Ptr) += " << -staticContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS)<< std::endl;
15386  }
15387 #endif
15388  (*f_BD_Equ_DI_Node_Ptr) += +staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD);
15389 
15390 
15391 #ifdef Xyce_DEBUG_DEVICE
15392  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15393  {
15394  Xyce::dout() << " (*f_BD_Equ_DI_Node_Ptr) += " << +staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD)<< std::endl;
15395  }
15396 #endif
15398 
15399 
15400 #ifdef Xyce_DEBUG_DEVICE
15401  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15402  {
15403  Xyce::dout() << " (*f_BD_Equ_BD_Node_Ptr) += " << +staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI) -staticContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD)<< std::endl;
15404  }
15405 #endif
15406  (*f_DI_Equ_BD_Node_Ptr) += -staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD);
15407 
15408 
15409 #ifdef Xyce_DEBUG_DEVICE
15410  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15411  {
15412  Xyce::dout() << " (*f_DI_Equ_BD_Node_Ptr) += " << -staticContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD)<< std::endl;
15413  }
15414 #endif
15415  (*f_G_Equ_G_Node_Ptr) += +staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP);
15416 
15417 
15418 #ifdef Xyce_DEBUG_DEVICE
15419  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15420  {
15421  Xyce::dout() << " (*f_G_Equ_G_Node_Ptr) += " << +staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP)<< std::endl;
15422  }
15423 #endif
15424  (*f_G_Equ_GP_Node_Ptr) += -staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP);
15425 
15426 
15427 #ifdef Xyce_DEBUG_DEVICE
15428  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15429  {
15430  Xyce::dout() << " (*f_G_Equ_GP_Node_Ptr) += " << -staticContributions[admsNodeID_G].dx(admsProbeID_V_G_GP)<< std::endl;
15431  }
15432 #endif
15433  (*f_GP_Equ_G_Node_Ptr) += +staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP);
15434 
15435 
15436 #ifdef Xyce_DEBUG_DEVICE
15437  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15438  {
15439  Xyce::dout() << " (*f_GP_Equ_G_Node_Ptr) += " << +staticContributions[admsNodeID_GP].dx(admsProbeID_V_G_GP)<< std::endl;
15440  }
15441 #endif
15442  (*f_S_Equ_S_Node_Ptr) += +staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI);
15443 
15444 
15445 #ifdef Xyce_DEBUG_DEVICE
15446  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15447  {
15448  Xyce::dout() << " (*f_S_Equ_S_Node_Ptr) += " << +staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI)<< std::endl;
15449  }
15450 #endif
15451  (*f_S_Equ_SI_Node_Ptr) += -staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI);
15452 
15453 
15454 #ifdef Xyce_DEBUG_DEVICE
15455  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15456  {
15457  Xyce::dout() << " (*f_S_Equ_SI_Node_Ptr) += " << -staticContributions[admsNodeID_S].dx(admsProbeID_V_S_SI)<< std::endl;
15458  }
15459 #endif
15460  (*f_SI_Equ_S_Node_Ptr) += +staticContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI);
15461 
15462 
15463 #ifdef Xyce_DEBUG_DEVICE
15464  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15465  {
15466  Xyce::dout() << " (*f_SI_Equ_S_Node_Ptr) += " << +staticContributions[admsNodeID_SI].dx(admsProbeID_V_S_SI)<< std::endl;
15467  }
15468 #endif
15469  (*f_D_Equ_D_Node_Ptr) += +staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI);
15470 
15471 
15472 #ifdef Xyce_DEBUG_DEVICE
15473  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15474  {
15475  Xyce::dout() << " (*f_D_Equ_D_Node_Ptr) += " << +staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI)<< std::endl;
15476  }
15477 #endif
15478  (*f_D_Equ_DI_Node_Ptr) += -staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI);
15479 
15480 
15481 #ifdef Xyce_DEBUG_DEVICE
15482  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15483  {
15484  Xyce::dout() << " (*f_D_Equ_DI_Node_Ptr) += " << -staticContributions[admsNodeID_D].dx(admsProbeID_V_D_DI)<< std::endl;
15485  }
15486 #endif
15487  (*f_DI_Equ_D_Node_Ptr) += +staticContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI);
15488 
15489 
15490 #ifdef Xyce_DEBUG_DEVICE
15491  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15492  {
15493  Xyce::dout() << " (*f_DI_Equ_D_Node_Ptr) += " << +staticContributions[admsNodeID_DI].dx(admsProbeID_V_D_DI)<< std::endl;
15494  }
15495 #endif
15496  (*f_BP_Equ_BI_Node_Ptr) += -staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI);
15497 
15498 
15499 #ifdef Xyce_DEBUG_DEVICE
15500  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15501  {
15502  Xyce::dout() << " (*f_BP_Equ_BI_Node_Ptr) += " << -staticContributions[admsNodeID_BP].dx(admsProbeID_V_BP_BI)<< std::endl;
15503  }
15504 #endif
15505  (*f_BI_Equ_BP_Node_Ptr) += +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI);
15506 
15507 
15508 #ifdef Xyce_DEBUG_DEVICE
15509  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15510  {
15511  Xyce::dout() << " (*f_BI_Equ_BP_Node_Ptr) += " << +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BP_BI)<< std::endl;
15512  }
15513 #endif
15515 
15516 
15517 #ifdef Xyce_DEBUG_DEVICE
15518  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15519  {
15521  }
15522 #endif
15523  (*f_BS_Equ_BI_Node_Ptr) += -staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI);
15524 
15525 
15526 #ifdef Xyce_DEBUG_DEVICE
15527  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15528  {
15529  Xyce::dout() << " (*f_BS_Equ_BI_Node_Ptr) += " << -staticContributions[admsNodeID_BS].dx(admsProbeID_V_BS_BI)<< std::endl;
15530  }
15531 #endif
15532  (*f_BI_Equ_BS_Node_Ptr) += +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI);
15533 
15534 
15535 #ifdef Xyce_DEBUG_DEVICE
15536  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15537  {
15538  Xyce::dout() << " (*f_BI_Equ_BS_Node_Ptr) += " << +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BS_BI)<< std::endl;
15539  }
15540 #endif
15541  (*f_BD_Equ_BI_Node_Ptr) += -staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI);
15542 
15543 
15544 #ifdef Xyce_DEBUG_DEVICE
15545  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15546  {
15547  Xyce::dout() << " (*f_BD_Equ_BI_Node_Ptr) += " << -staticContributions[admsNodeID_BD].dx(admsProbeID_V_BD_BI)<< std::endl;
15548  }
15549 #endif
15550  (*f_BI_Equ_BD_Node_Ptr) += +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI);
15551 
15552 
15553 #ifdef Xyce_DEBUG_DEVICE
15554  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15555  {
15556  Xyce::dout() << " (*f_BI_Equ_BD_Node_Ptr) += " << +staticContributions[admsNodeID_BI].dx(admsProbeID_V_BD_BI)<< std::endl;
15557  }
15558 #endif
15559  (*f_B_Equ_B_Node_Ptr) += +staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI);
15560 
15561 
15562 #ifdef Xyce_DEBUG_DEVICE
15563  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15564  {
15565  Xyce::dout() << " (*f_B_Equ_B_Node_Ptr) += " << +staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI)<< std::endl;
15566  }
15567 #endif
15568  (*f_B_Equ_BI_Node_Ptr) += -staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI);
15569 
15570 
15571 #ifdef Xyce_DEBUG_DEVICE
15572  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15573  {
15574  Xyce::dout() << " (*f_B_Equ_BI_Node_Ptr) += " << -staticContributions[admsNodeID_B].dx(admsProbeID_V_B_BI)<< std::endl;
15575  }
15576 #endif
15577  (*f_BI_Equ_B_Node_Ptr) += +staticContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI);
15578 
15579 
15580 #ifdef Xyce_DEBUG_DEVICE
15581  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15582  {
15583  Xyce::dout() << " (*f_BI_Equ_B_Node_Ptr) += " << +staticContributions[admsNodeID_BI].dx(admsProbeID_V_B_BI)<< std::endl;
15584  }
15585 #endif
15586 
15587 
15588  return bsuccess;
15589 }
15590 
15591 
15592 //-----------------------------------------------------------------------------
15593 // Function : Instance::loadDAEdQdx
15594 // Purpose :
15595 // Special Notes : Load the dQdx ("dynamic jacobian") matrix
15596 // Scope : public
15597 // Creator : admsXml
15598 // Creation Date :
15599 //-----------------------------------------------------------------------------
15601 {
15602  bool bsuccess = true;
15603  N_LAS_Matrix * dQdxMatPtr = extData.dQdxMatrixPtr;
15604 
15605 #ifdef Xyce_DEBUG_DEVICE
15606  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15607  {
15608  Xyce::dout() << subsection_divider << std::endl;
15609  Xyce::dout() << "ADMSPSP103VA::Instance::loadDAEdQdx (" << getName() << "):" << std::endl;
15610  }
15611 #endif
15613 
15614 
15615 #ifdef Xyce_DEBUG_DEVICE
15616  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15617  {
15619  }
15620 #endif
15621  (*q_DI_Equ_BP_Node_Ptr) += -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP);
15622 
15623 
15624 #ifdef Xyce_DEBUG_DEVICE
15625  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15626  {
15627  Xyce::dout() << " (*q_DI_Equ_BP_Node_Ptr) += " << -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BP)<< std::endl;
15628  }
15629 #endif
15631 
15632 
15633 #ifdef Xyce_DEBUG_DEVICE
15634  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15635  {
15637  }
15638 #endif
15639  (*q_BP_Equ_BP_Node_Ptr) += -dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP);
15640 
15641 
15642 #ifdef Xyce_DEBUG_DEVICE
15643  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15644  {
15645  Xyce::dout() << " (*q_BP_Equ_BP_Node_Ptr) += " << -dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_SI_BP)<< std::endl;
15646  }
15647 #endif
15648  (*q_DI_Equ_GP_Node_Ptr) += +dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI);
15649 
15650 
15651 #ifdef Xyce_DEBUG_DEVICE
15652  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15653  {
15654  Xyce::dout() << " (*q_DI_Equ_GP_Node_Ptr) += " << +dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_GP_SI)<< std::endl;
15655  }
15656 #endif
15657  (*q_BP_Equ_GP_Node_Ptr) += +dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI);
15658 
15659 
15660 #ifdef Xyce_DEBUG_DEVICE
15661  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15662  {
15663  Xyce::dout() << " (*q_BP_Equ_GP_Node_Ptr) += " << +dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_GP_SI)<< std::endl;
15664  }
15665 #endif
15667 
15668 
15669 #ifdef Xyce_DEBUG_DEVICE
15670  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15671  {
15672  Xyce::dout() << " (*q_DI_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD) +dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_SI)<< std::endl;
15673  }
15674 #endif
15675  (*q_BP_Equ_DI_Node_Ptr) += +dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI);
15676 
15677 
15678 #ifdef Xyce_DEBUG_DEVICE
15679  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15680  {
15681  Xyce::dout() << " (*q_BP_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BP].dx(admsProbeID_V_DI_SI)<< std::endl;
15682  }
15683 #endif
15685 
15686 
15687 #ifdef Xyce_DEBUG_DEVICE
15688  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15689  {
15691  }
15692 #endif
15693  (*q_SI_Equ_BP_Node_Ptr) += -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP);
15694 
15695 
15696 #ifdef Xyce_DEBUG_DEVICE
15697  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15698  {
15699  Xyce::dout() << " (*q_SI_Equ_BP_Node_Ptr) += " << -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BP)<< std::endl;
15700  }
15701 #endif
15702  (*q_SI_Equ_GP_Node_Ptr) += +dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI);
15703 
15704 
15705 #ifdef Xyce_DEBUG_DEVICE
15706  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15707  {
15708  Xyce::dout() << " (*q_SI_Equ_GP_Node_Ptr) += " << +dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_GP_SI)<< std::endl;
15709  }
15710 #endif
15712 
15713 
15714 #ifdef Xyce_DEBUG_DEVICE
15715  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15716  {
15717  Xyce::dout() << " (*q_SI_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD) +dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_SI)<< std::endl;
15718  }
15719 #endif
15721 
15722 
15723 #ifdef Xyce_DEBUG_DEVICE
15724  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15725  {
15727  }
15728 #endif
15729  (*q_GP_Equ_BP_Node_Ptr) += -dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP);
15730 
15731 
15732 #ifdef Xyce_DEBUG_DEVICE
15733  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15734  {
15735  Xyce::dout() << " (*q_GP_Equ_BP_Node_Ptr) += " << -dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_SI_BP)<< std::endl;
15736  }
15737 #endif
15738  (*q_GP_Equ_DI_Node_Ptr) += +dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI);
15739 
15740 
15741 #ifdef Xyce_DEBUG_DEVICE
15742  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15743  {
15744  Xyce::dout() << " (*q_GP_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_DI_SI)<< std::endl;
15745  }
15746 #endif
15747  (*q_GP_Equ_GP_Node_Ptr) += +dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI);
15748 
15749 
15750 #ifdef Xyce_DEBUG_DEVICE
15751  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15752  {
15753  Xyce::dout() << " (*q_GP_Equ_GP_Node_Ptr) += " << +dynamicContributions[admsNodeID_GP].dx(admsProbeID_V_GP_SI)<< std::endl;
15754  }
15755 #endif
15756  (*q_BS_Equ_SI_Node_Ptr) += +dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS);
15757 
15758 
15759 #ifdef Xyce_DEBUG_DEVICE
15760  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15761  {
15762  Xyce::dout() << " (*q_BS_Equ_SI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS)<< std::endl;
15763  }
15764 #endif
15765  (*q_BS_Equ_BS_Node_Ptr) += -dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS);
15766 
15767 
15768 #ifdef Xyce_DEBUG_DEVICE
15769  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15770  {
15771  Xyce::dout() << " (*q_BS_Equ_BS_Node_Ptr) += " << -dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_SI_BS)<< std::endl;
15772  }
15773 #endif
15774  (*q_SI_Equ_BS_Node_Ptr) += -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS);
15775 
15776 
15777 #ifdef Xyce_DEBUG_DEVICE
15778  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15779  {
15780  Xyce::dout() << " (*q_SI_Equ_BS_Node_Ptr) += " << -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_SI_BS)<< std::endl;
15781  }
15782 #endif
15783  (*q_BS_Equ_DI_Node_Ptr) += +dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD);
15784 
15785 
15786 #ifdef Xyce_DEBUG_DEVICE
15787  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15788  {
15789  Xyce::dout() << " (*q_BS_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD)<< std::endl;
15790  }
15791 #endif
15792  (*q_BS_Equ_BD_Node_Ptr) += -dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD);
15793 
15794 
15795 #ifdef Xyce_DEBUG_DEVICE
15796  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15797  {
15798  Xyce::dout() << " (*q_BS_Equ_BD_Node_Ptr) += " << -dynamicContributions[admsNodeID_BS].dx(admsProbeID_V_DI_BD)<< std::endl;
15799  }
15800 #endif
15801  (*q_SI_Equ_BD_Node_Ptr) += -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD);
15802 
15803 
15804 #ifdef Xyce_DEBUG_DEVICE
15805  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15806  {
15807  Xyce::dout() << " (*q_SI_Equ_BD_Node_Ptr) += " << -dynamicContributions[admsNodeID_SI].dx(admsProbeID_V_DI_BD)<< std::endl;
15808  }
15809 #endif
15810  (*q_BD_Equ_SI_Node_Ptr) += +dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS);
15811 
15812 
15813 #ifdef Xyce_DEBUG_DEVICE
15814  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15815  {
15816  Xyce::dout() << " (*q_BD_Equ_SI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS)<< std::endl;
15817  }
15818 #endif
15819  (*q_BD_Equ_BS_Node_Ptr) += -dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS);
15820 
15821 
15822 #ifdef Xyce_DEBUG_DEVICE
15823  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15824  {
15825  Xyce::dout() << " (*q_BD_Equ_BS_Node_Ptr) += " << -dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_SI_BS)<< std::endl;
15826  }
15827 #endif
15828  (*q_DI_Equ_BS_Node_Ptr) += -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS);
15829 
15830 
15831 #ifdef Xyce_DEBUG_DEVICE
15832  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15833  {
15834  Xyce::dout() << " (*q_DI_Equ_BS_Node_Ptr) += " << -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_SI_BS)<< std::endl;
15835  }
15836 #endif
15837  (*q_BD_Equ_DI_Node_Ptr) += +dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD);
15838 
15839 
15840 #ifdef Xyce_DEBUG_DEVICE
15841  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15842  {
15843  Xyce::dout() << " (*q_BD_Equ_DI_Node_Ptr) += " << +dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD)<< std::endl;
15844  }
15845 #endif
15846  (*q_BD_Equ_BD_Node_Ptr) += -dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD);
15847 
15848 
15849 #ifdef Xyce_DEBUG_DEVICE
15850  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15851  {
15852  Xyce::dout() << " (*q_BD_Equ_BD_Node_Ptr) += " << -dynamicContributions[admsNodeID_BD].dx(admsProbeID_V_DI_BD)<< std::endl;
15853  }
15854 #endif
15855  (*q_DI_Equ_BD_Node_Ptr) += -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD);
15856 
15857 
15858 #ifdef Xyce_DEBUG_DEVICE
15859  if (getDeviceOptions().debugLevel > 0 && getSolverState().debugTimeFlag)
15860  {
15861  Xyce::dout() << " (*q_DI_Equ_BD_Node_Ptr) += " << -dynamicContributions[admsNodeID_DI].dx(admsProbeID_V_DI_BD)<< std::endl;
15862  }
15863 #endif
15864 
15865 
15866  return bsuccess;
15867 }
15868 
15869 //-----------------------------------------------------------------------------
15870 // Function : Instance::updateTemperature
15871 // Purpose : Set temperature and update any parameters that depend on it
15872 // Special Notes : In Xyce ADMS, we'll simply copy the temperature, which is
15873 // in Kelvin, to our "admsTemperature" variable, which needs
15874 // to be in Celsius.
15875 // Scope : public
15876 // Creator : admsXml
15877 // Creation Date :
15878 //-----------------------------------------------------------------------------
15879 bool Instance::updateTemperature(const double & temperatureTemp)
15880 {
15881 
15882  admsTemperature = temperatureTemp;
15883  adms_vt_nom = adms_vt(temperatureTemp);
15884 
15885  return true;
15886 }
15887 
15888 // Class Model
15889 //-----------------------------------------------------------------------------
15890 // Function : Model::processParams
15891 // Purpose :
15892 // Special Notes :
15893 // Scope : public
15894 // Creator : admsXml
15895 // Creation Date :
15896 //-----------------------------------------------------------------------------
15898 {
15899 
15900  // Now we need to check that any parameters are within their ranges as
15901  // specified in the verilog:
15902 
15903  // Parameter TYPE : [ (-1.0), 1.0 ]
15904  if ( (!((TYPE >=(-1.0) && TYPE <=1.0 ))) )
15905  {
15906  UserError0(*this) << "ADMSPSP103VA: Parameter TYPE value " << TYPE << " out of range [ (-1.0), 1.0 ]";
15907  }
15908 
15909  // Parameter TR : [ (-273.0), (+inf) [
15910  if ( (!((TR >=(-273.0)))) )
15911  {
15912  UserError0(*this) << "ADMSPSP103VA: Parameter TR value " << TR << " out of range [ (-273.0), (+inf) [";
15913  }
15914 
15915  // Parameter SWGEO : [ 0.0, 2.0 ]
15916  if ( (!((SWGEO >=0.0 && SWGEO <=2.0 ))) )
15917  {
15918  UserError0(*this) << "ADMSPSP103VA: Parameter SWGEO value " << SWGEO << " out of range [ 0.0, 2.0 ]";
15919  }
15920 
15921  // Parameter SWIGATE : [ 0.0, 1.0 ]
15922  if ( (!((SWIGATE >=0.0 && SWIGATE <=1.0 ))) )
15923  {
15924  UserError0(*this) << "ADMSPSP103VA: Parameter SWIGATE value " << SWIGATE << " out of range [ 0.0, 1.0 ]";
15925  }
15926 
15927  // Parameter SWIMPACT : [ 0.0, 1.0 ]
15928  if ( (!((SWIMPACT >=0.0 && SWIMPACT <=1.0 ))) )
15929  {
15930  UserError0(*this) << "ADMSPSP103VA: Parameter SWIMPACT value " << SWIMPACT << " out of range [ 0.0, 1.0 ]";
15931  }
15932 
15933  // Parameter SWGIDL : [ 0.0, 1.0 ]
15934  if ( (!((SWGIDL >=0.0 && SWGIDL <=1.0 ))) )
15935  {
15936  UserError0(*this) << "ADMSPSP103VA: Parameter SWGIDL value " << SWGIDL << " out of range [ 0.0, 1.0 ]";
15937  }
15938 
15939  // Parameter SWJUNCAP : [ 0.0, 3.0 ]
15940  if ( (!((SWJUNCAP >=0.0 && SWJUNCAP <=3.0 ))) )
15941  {
15942  UserError0(*this) << "ADMSPSP103VA: Parameter SWJUNCAP value " << SWJUNCAP << " out of range [ 0.0, 3.0 ]";
15943  }
15944 
15945  // Parameter SWNUD : [ 0.0, 2.0 ]
15946  if ( (!((SWNUD >=0.0 && SWNUD <=2.0 ))) )
15947  {
15948  UserError0(*this) << "ADMSPSP103VA: Parameter SWNUD value " << SWNUD << " out of range [ 0.0, 2.0 ]";
15949  }
15950 
15951  // Parameter SWDELVTAC : [ 0.0, 1.0 ]
15952  if ( (!((SWDELVTAC >=0.0 && SWDELVTAC <=1.0 ))) )
15953  {
15954  UserError0(*this) << "ADMSPSP103VA: Parameter SWDELVTAC value " << SWDELVTAC << " out of range [ 0.0, 1.0 ]";
15955  }
15956 
15957  // Parameter QMC : [ 0.0, (+inf) [
15958  if ( (!((QMC >=0.0))) )
15959  {
15960  UserError0(*this) << "ADMSPSP103VA: Parameter QMC value " << QMC << " out of range [ 0.0, (+inf) [";
15961  }
15962 
15963  // Parameter TOX : [ 1e-10, (+inf) [
15964  if ( (!((TOX >=1e-10))) )
15965  {
15966  UserError0(*this) << "ADMSPSP103VA: Parameter TOX value " << TOX << " out of range [ 1e-10, (+inf) [";
15967  }
15968 
15969  // Parameter EPSROX : [ 1.0, (+inf) [
15970  if ( (!((EPSROX >=1.0))) )
15971  {
15972  UserError0(*this) << "ADMSPSP103VA: Parameter EPSROX value " << EPSROX << " out of range [ 1.0, (+inf) [";
15973  }
15974 
15975  // Parameter NEFF : [ 1e20, 1e26 ]
15976  if ( (!((NEFF >=1e20 && NEFF <=1e26 ))) )
15977  {
15978  UserError0(*this) << "ADMSPSP103VA: Parameter NEFF value " << NEFF << " out of range [ 1e20, 1e26 ]";
15979  }
15980 
15981  // Parameter FACNEFFAC : [ 0.0, (+inf) [
15982  if ( (!((FACNEFFAC >=0.0))) )
15983  {
15984  UserError0(*this) << "ADMSPSP103VA: Parameter FACNEFFAC value " << FACNEFFAC << " out of range [ 0.0, (+inf) [";
15985  }
15986 
15987  // Parameter GFACNUD : [ 0.01, (+inf) [
15988  if ( (!((GFACNUD >=0.01))) )
15989  {
15990  UserError0(*this) << "ADMSPSP103VA: Parameter GFACNUD value " << GFACNUD << " out of range [ 0.01, (+inf) [";
15991  }
15992 
15993  // Parameter VSBNUD : [ 0.0, (+inf) [
15994  if ( (!((VSBNUD >=0.0))) )
15995  {
15996  UserError0(*this) << "ADMSPSP103VA: Parameter VSBNUD value " << VSBNUD << " out of range [ 0.0, (+inf) [";
15997  }
15998 
15999  // Parameter DVSBNUD : [ 0.1, (+inf) [
16000  if ( (!((DVSBNUD >=0.1))) )
16001  {
16002  UserError0(*this) << "ADMSPSP103VA: Parameter DVSBNUD value " << DVSBNUD << " out of range [ 0.1, (+inf) [";
16003  }
16004 
16005  // Parameter NSLP : [ 1e-3, (+inf) [
16006  if ( (!((NSLP >=1e-3))) )
16007  {
16008  UserError0(*this) << "ADMSPSP103VA: Parameter NSLP value " << NSLP << " out of range [ 1e-3, (+inf) [";
16009  }
16010 
16011  // Parameter DNSUB : [ 0.0, 1.0 ]
16012  if ( (!((DNSUB >=0.0 && DNSUB <=1.0 ))) )
16013  {
16014  UserError0(*this) << "ADMSPSP103VA: Parameter DNSUB value " << DNSUB << " out of range [ 0.0, 1.0 ]";
16015  }
16016 
16017  // Parameter NP : [ 0.0, (+inf) [
16018  if ( (!((NP >=0.0))) )
16019  {
16020  UserError0(*this) << "ADMSPSP103VA: Parameter NP value " << NP << " out of range [ 0.0, (+inf) [";
16021  }
16022 
16023  // Parameter CT : [ 0.0, (+inf) [
16024  if ( (!((CT >=0.0))) )
16025  {
16026  UserError0(*this) << "ADMSPSP103VA: Parameter CT value " << CT << " out of range [ 0.0, (+inf) [";
16027  }
16028 
16029  // Parameter TOXOV : [ 1e-10, (+inf) [
16030  if ( (!((TOXOV >=1e-10))) )
16031  {
16032  UserError0(*this) << "ADMSPSP103VA: Parameter TOXOV value " << TOXOV << " out of range [ 1e-10, (+inf) [";
16033  }
16034 
16035  // Parameter TOXOVD : [ 1e-10, (+inf) [
16036  if ( (!((TOXOVD >=1e-10))) )
16037  {
16038  UserError0(*this) << "ADMSPSP103VA: Parameter TOXOVD value " << TOXOVD << " out of range [ 1e-10, (+inf) [";
16039  }
16040 
16041  // Parameter NOV : [ 1e20, 1e27 ]
16042  if ( (!((NOV >=1e20 && NOV <=1e27 ))) )
16043  {
16044  UserError0(*this) << "ADMSPSP103VA: Parameter NOV value " << NOV << " out of range [ 1e20, 1e27 ]";
16045  }
16046 
16047  // Parameter NOVD : [ 1e20, 1e27 ]
16048  if ( (!((NOVD >=1e20 && NOVD <=1e27 ))) )
16049  {
16050  UserError0(*this) << "ADMSPSP103VA: Parameter NOVD value " << NOVD << " out of range [ 1e20, 1e27 ]";
16051  }
16052 
16053  // Parameter CF : [ 0.0, (+inf) [
16054  if ( (!((CF >=0.0))) )
16055  {
16056  UserError0(*this) << "ADMSPSP103VA: Parameter CF value " << CF << " out of range [ 0.0, (+inf) [";
16057  }
16058 
16059  // Parameter CFB : [ 0.0, 1.0 ]
16060  if ( (!((CFB >=0.0 && CFB <=1.0 ))) )
16061  {
16062  UserError0(*this) << "ADMSPSP103VA: Parameter CFB value " << CFB << " out of range [ 0.0, 1.0 ]";
16063  }
16064 
16065  // Parameter BETN : [ 0.0, (+inf) [
16066  if ( (!((BETN >=0.0))) )
16067  {
16068  UserError0(*this) << "ADMSPSP103VA: Parameter BETN value " << BETN << " out of range [ 0.0, (+inf) [";
16069  }
16070 
16071  // Parameter MUE : [ 0.0, (+inf) [
16072  if ( (!((MUE >=0.0))) )
16073  {
16074  UserError0(*this) << "ADMSPSP103VA: Parameter MUE value " << MUE << " out of range [ 0.0, (+inf) [";
16075  }
16076 
16077  // Parameter THEMU : [ 0.0, (+inf) [
16078  if ( (!((THEMU >=0.0))) )
16079  {
16080  UserError0(*this) << "ADMSPSP103VA: Parameter THEMU value " << THEMU << " out of range [ 0.0, (+inf) [";
16081  }
16082 
16083  // Parameter CS : [ 0.0, (+inf) [
16084  if ( (!((CS >=0.0))) )
16085  {
16086  UserError0(*this) << "ADMSPSP103VA: Parameter CS value " << CS << " out of range [ 0.0, (+inf) [";
16087  }
16088 
16089  // Parameter XCOR : [ 0.0, (+inf) [
16090  if ( (!((XCOR >=0.0))) )
16091  {
16092  UserError0(*this) << "ADMSPSP103VA: Parameter XCOR value " << XCOR << " out of range [ 0.0, (+inf) [";
16093  }
16094 
16095  // Parameter FETA : [ 0.0, (+inf) [
16096  if ( (!((FETA >=0.0))) )
16097  {
16098  UserError0(*this) << "ADMSPSP103VA: Parameter FETA value " << FETA << " out of range [ 0.0, (+inf) [";
16099  }
16100 
16101  // Parameter RS : [ 0.0, (+inf) [
16102  if ( (!((RS >=0.0))) )
16103  {
16104  UserError0(*this) << "ADMSPSP103VA: Parameter RS value " << RS << " out of range [ 0.0, (+inf) [";
16105  }
16106 
16107  // Parameter RSB : [ (-0.5), 1.0 ]
16108  if ( (!((RSB >=(-0.5) && RSB <=1.0 ))) )
16109  {
16110  UserError0(*this) << "ADMSPSP103VA: Parameter RSB value " << RSB << " out of range [ (-0.5), 1.0 ]";
16111  }
16112 
16113  // Parameter RSG : [ (-0.5), (+inf) [
16114  if ( (!((RSG >=(-0.5)))) )
16115  {
16116  UserError0(*this) << "ADMSPSP103VA: Parameter RSG value " << RSG << " out of range [ (-0.5), (+inf) [";
16117  }
16118 
16119  // Parameter THESAT : [ 0.0, (+inf) [
16120  if ( (!((THESAT >=0.0))) )
16121  {
16122  UserError0(*this) << "ADMSPSP103VA: Parameter THESAT value " << THESAT << " out of range [ 0.0, (+inf) [";
16123  }
16124 
16125  // Parameter THESATB : [ (-0.5), 1.0 ]
16126  if ( (!((THESATB >=(-0.5) && THESATB <=1.0 ))) )
16127  {
16128  UserError0(*this) << "ADMSPSP103VA: Parameter THESATB value " << THESATB << " out of range [ (-0.5), 1.0 ]";
16129  }
16130 
16131  // Parameter THESATG : [ (-0.5), (+inf) [
16132  if ( (!((THESATG >=(-0.5)))) )
16133  {
16134  UserError0(*this) << "ADMSPSP103VA: Parameter THESATG value " << THESATG << " out of range [ (-0.5), (+inf) [";
16135  }
16136 
16137  // Parameter AX : [ 2.0, (+inf) [
16138  if ( (!((AX >=2.0))) )
16139  {
16140  UserError0(*this) << "ADMSPSP103VA: Parameter AX value " << AX << " out of range [ 2.0, (+inf) [";
16141  }
16142 
16143  // Parameter ALP : [ 0.0, (+inf) [
16144  if ( (!((ALP >=0.0))) )
16145  {
16146  UserError0(*this) << "ADMSPSP103VA: Parameter ALP value " << ALP << " out of range [ 0.0, (+inf) [";
16147  }
16148 
16149  // Parameter ALP1 : [ 0.0, (+inf) [
16150  if ( (!((ALP1 >=0.0))) )
16151  {
16152  UserError0(*this) << "ADMSPSP103VA: Parameter ALP1 value " << ALP1 << " out of range [ 0.0, (+inf) [";
16153  }
16154 
16155  // Parameter ALP2 : [ 0.0, (+inf) [
16156  if ( (!((ALP2 >=0.0))) )
16157  {
16158  UserError0(*this) << "ADMSPSP103VA: Parameter ALP2 value " << ALP2 << " out of range [ 0.0, (+inf) [";
16159  }
16160 
16161  // Parameter VP : [ 1e-10, (+inf) [
16162  if ( (!((VP >=1e-10))) )
16163  {
16164  UserError0(*this) << "ADMSPSP103VA: Parameter VP value " << VP << " out of range [ 1e-10, (+inf) [";
16165  }
16166 
16167  // Parameter A1 : [ 0.0, (+inf) [
16168  if ( (!((A1 >=0.0))) )
16169  {
16170  UserError0(*this) << "ADMSPSP103VA: Parameter A1 value " << A1 << " out of range [ 0.0, (+inf) [";
16171  }
16172 
16173  // Parameter A2 : [ 0.0, (+inf) [
16174  if ( (!((A2 >=0.0))) )
16175  {
16176  UserError0(*this) << "ADMSPSP103VA: Parameter A2 value " << A2 << " out of range [ 0.0, (+inf) [";
16177  }
16178 
16179  // Parameter A3 : [ 0.0, (+inf) [
16180  if ( (!((A3 >=0.0))) )
16181  {
16182  UserError0(*this) << "ADMSPSP103VA: Parameter A3 value " << A3 << " out of range [ 0.0, (+inf) [";
16183  }
16184 
16185  // Parameter A4 : [ 0.0, (+inf) [
16186  if ( (!((A4 >=0.0))) )
16187  {
16188  UserError0(*this) << "ADMSPSP103VA: Parameter A4 value " << A4 << " out of range [ 0.0, (+inf) [";
16189  }
16190 
16191  // Parameter GCO : [ (-10.0), 10.0 ]
16192  if ( (!((GCO >=(-10.0) && GCO <=10.0 ))) )
16193  {
16194  UserError0(*this) << "ADMSPSP103VA: Parameter GCO value " << GCO << " out of range [ (-10.0), 10.0 ]";
16195  }
16196 
16197  // Parameter IGINV : [ 0.0, (+inf) [
16198  if ( (!((IGINV >=0.0))) )
16199  {
16200  UserError0(*this) << "ADMSPSP103VA: Parameter IGINV value " << IGINV << " out of range [ 0.0, (+inf) [";
16201  }
16202 
16203  // Parameter IGOV : [ 0.0, (+inf) [
16204  if ( (!((IGOV >=0.0))) )
16205  {
16206  UserError0(*this) << "ADMSPSP103VA: Parameter IGOV value " << IGOV << " out of range [ 0.0, (+inf) [";
16207  }
16208 
16209  // Parameter IGOVD : [ 0.0, (+inf) [
16210  if ( (!((IGOVD >=0.0))) )
16211  {
16212  UserError0(*this) << "ADMSPSP103VA: Parameter IGOVD value " << IGOVD << " out of range [ 0.0, (+inf) [";
16213  }
16214 
16215  // Parameter GC2 : [ 0.0, 10.0 ]
16216  if ( (!((GC2 >=0.0 && GC2 <=10.0 ))) )
16217  {
16218  UserError0(*this) << "ADMSPSP103VA: Parameter GC2 value " << GC2 << " out of range [ 0.0, 10.0 ]";
16219  }
16220 
16221  // Parameter GC3 : [ (-2.0), 2.0 ]
16222  if ( (!((GC3 >=(-2.0) && GC3 <=2.0 ))) )
16223  {
16224  UserError0(*this) << "ADMSPSP103VA: Parameter GC3 value " << GC3 << " out of range [ (-2.0), 2.0 ]";
16225  }
16226 
16227  // Parameter CHIB : [ 1.0, (+inf) [
16228  if ( (!((CHIB >=1.0))) )
16229  {
16230  UserError0(*this) << "ADMSPSP103VA: Parameter CHIB value " << CHIB << " out of range [ 1.0, (+inf) [";
16231  }
16232 
16233  // Parameter AGIDL : [ 0.0, (+inf) [
16234  if ( (!((AGIDL >=0.0))) )
16235  {
16236  UserError0(*this) << "ADMSPSP103VA: Parameter AGIDL value " << AGIDL << " out of range [ 0.0, (+inf) [";
16237  }
16238 
16239  // Parameter AGIDLD : [ 0.0, (+inf) [
16240  if ( (!((AGIDLD >=0.0))) )
16241  {
16242  UserError0(*this) << "ADMSPSP103VA: Parameter AGIDLD value " << AGIDLD << " out of range [ 0.0, (+inf) [";
16243  }
16244 
16245  // Parameter BGIDL : [ 0.0, (+inf) [
16246  if ( (!((BGIDL >=0.0))) )
16247  {
16248  UserError0(*this) << "ADMSPSP103VA: Parameter BGIDL value " << BGIDL << " out of range [ 0.0, (+inf) [";
16249  }
16250 
16251  // Parameter BGIDLD : [ 0.0, (+inf) [
16252  if ( (!((BGIDLD >=0.0))) )
16253  {
16254  UserError0(*this) << "ADMSPSP103VA: Parameter BGIDLD value " << BGIDLD << " out of range [ 0.0, (+inf) [";
16255  }
16256 
16257  // Parameter COX : [ 0.0, (+inf) [
16258  if ( (!((COX >=0.0))) )
16259  {
16260  UserError0(*this) << "ADMSPSP103VA: Parameter COX value " << COX << " out of range [ 0.0, (+inf) [";
16261  }
16262 
16263  // Parameter CGOV : [ 0.0, (+inf) [
16264  if ( (!((CGOV >=0.0))) )
16265  {
16266  UserError0(*this) << "ADMSPSP103VA: Parameter CGOV value " << CGOV << " out of range [ 0.0, (+inf) [";
16267  }
16268 
16269  // Parameter CGOVD : [ 0.0, (+inf) [
16270  if ( (!((CGOVD >=0.0))) )
16271  {
16272  UserError0(*this) << "ADMSPSP103VA: Parameter CGOVD value " << CGOVD << " out of range [ 0.0, (+inf) [";
16273  }
16274 
16275  // Parameter CGBOV : [ 0.0, (+inf) [
16276  if ( (!((CGBOV >=0.0))) )
16277  {
16278  UserError0(*this) << "ADMSPSP103VA: Parameter CGBOV value " << CGBOV << " out of range [ 0.0, (+inf) [";
16279  }
16280 
16281  // Parameter CFR : [ 0.0, (+inf) [
16282  if ( (!((CFR >=0.0))) )
16283  {
16284  UserError0(*this) << "ADMSPSP103VA: Parameter CFR value " << CFR << " out of range [ 0.0, (+inf) [";
16285  }
16286 
16287  // Parameter CFRD : [ 0.0, (+inf) [
16288  if ( (!((CFRD >=0.0))) )
16289  {
16290  UserError0(*this) << "ADMSPSP103VA: Parameter CFRD value " << CFRD << " out of range [ 0.0, (+inf) [";
16291  }
16292 
16293  // Parameter FNT : [ 0.0, (+inf) [
16294  if ( (!((FNT >=0.0))) )
16295  {
16296  UserError0(*this) << "ADMSPSP103VA: Parameter FNT value " << FNT << " out of range [ 0.0, (+inf) [";
16297  }
16298 
16299  // Parameter NFA : [ 0.0, (+inf) [
16300  if ( (!((NFA >=0.0))) )
16301  {
16302  UserError0(*this) << "ADMSPSP103VA: Parameter NFA value " << NFA << " out of range [ 0.0, (+inf) [";
16303  }
16304 
16305  // Parameter NFB : [ 0.0, (+inf) [
16306  if ( (!((NFB >=0.0))) )
16307  {
16308  UserError0(*this) << "ADMSPSP103VA: Parameter NFB value " << NFB << " out of range [ 0.0, (+inf) [";
16309  }
16310 
16311  // Parameter NFC : [ 0.0, (+inf) [
16312  if ( (!((NFC >=0.0))) )
16313  {
16314  UserError0(*this) << "ADMSPSP103VA: Parameter NFC value " << NFC << " out of range [ 0.0, (+inf) [";
16315  }
16316 
16317  // Parameter EF : [ 0.0, (+inf) [
16318  if ( (!((EF >=0.0))) )
16319  {
16320  UserError0(*this) << "ADMSPSP103VA: Parameter EF value " << EF << " out of range [ 0.0, (+inf) [";
16321  }
16322 
16323  // Parameter RG : [ 0.0, (+inf) [
16324  if ( (!((RG >=0.0))) )
16325  {
16326  UserError0(*this) << "ADMSPSP103VA: Parameter RG value " << RG << " out of range [ 0.0, (+inf) [";
16327  }
16328 
16329  // Parameter RSE : [ 0.0, (+inf) [
16330  if ( (!((RSE >=0.0))) )
16331  {
16332  UserError0(*this) << "ADMSPSP103VA: Parameter RSE value " << RSE << " out of range [ 0.0, (+inf) [";
16333  }
16334 
16335  // Parameter RDE : [ 0.0, (+inf) [
16336  if ( (!((RDE >=0.0))) )
16337  {
16338  UserError0(*this) << "ADMSPSP103VA: Parameter RDE value " << RDE << " out of range [ 0.0, (+inf) [";
16339  }
16340 
16341  // Parameter RBULK : [ 0.0, (+inf) [
16342  if ( (!((RBULK >=0.0))) )
16343  {
16344  UserError0(*this) << "ADMSPSP103VA: Parameter RBULK value " << RBULK << " out of range [ 0.0, (+inf) [";
16345  }
16346 
16347  // Parameter RWELL : [ 0.0, (+inf) [
16348  if ( (!((RWELL >=0.0))) )
16349  {
16350  UserError0(*this) << "ADMSPSP103VA: Parameter RWELL value " << RWELL << " out of range [ 0.0, (+inf) [";
16351  }
16352 
16353  // Parameter RJUNS : [ 0.0, (+inf) [
16354  if ( (!((RJUNS >=0.0))) )
16355  {
16356  UserError0(*this) << "ADMSPSP103VA: Parameter RJUNS value " << RJUNS << " out of range [ 0.0, (+inf) [";
16357  }
16358 
16359  // Parameter RJUND : [ 0.0, (+inf) [
16360  if ( (!((RJUND >=0.0))) )
16361  {
16362  UserError0(*this) << "ADMSPSP103VA: Parameter RJUND value " << RJUND << " out of range [ 0.0, (+inf) [";
16363  }
16364 
16365  // Parameter TOXO : [ 1e-10, (+inf) [
16366  if ( (!((TOXO >=1e-10))) )
16367  {
16368  UserError0(*this) << "ADMSPSP103VA: Parameter TOXO value " << TOXO << " out of range [ 1e-10, (+inf) [";
16369  }
16370 
16371  // Parameter EPSROXO : [ 1.0, (+inf) [
16372  if ( (!((EPSROXO >=1.0))) )
16373  {
16374  UserError0(*this) << "ADMSPSP103VA: Parameter EPSROXO value " << EPSROXO << " out of range [ 1.0, (+inf) [";
16375  }
16376 
16377  // Parameter NSUBO : [ 1e20, (+inf) [
16378  if ( (!((NSUBO >=1e20))) )
16379  {
16380  UserError0(*this) << "ADMSPSP103VA: Parameter NSUBO value " << NSUBO << " out of range [ 1e20, (+inf) [";
16381  }
16382 
16383  // Parameter WSEG : [ 1e-10, (+inf) [
16384  if ( (!((WSEG >=1e-10))) )
16385  {
16386  UserError0(*this) << "ADMSPSP103VA: Parameter WSEG value " << WSEG << " out of range [ 1e-10, (+inf) [";
16387  }
16388 
16389  // Parameter NPCK : [ 0.0, (+inf) [
16390  if ( (!((NPCK >=0.0))) )
16391  {
16392  UserError0(*this) << "ADMSPSP103VA: Parameter NPCK value " << NPCK << " out of range [ 0.0, (+inf) [";
16393  }
16394 
16395  // Parameter WSEGP : [ 1e-10, (+inf) [
16396  if ( (!((WSEGP >=1e-10))) )
16397  {
16398  UserError0(*this) << "ADMSPSP103VA: Parameter WSEGP value " << WSEGP << " out of range [ 1e-10, (+inf) [";
16399  }
16400 
16401  // Parameter LPCK : [ 1e-10, (+inf) [
16402  if ( (!((LPCK >=1e-10))) )
16403  {
16404  UserError0(*this) << "ADMSPSP103VA: Parameter LPCK value " << LPCK << " out of range [ 1e-10, (+inf) [";
16405  }
16406 
16407  // Parameter TOXOVO : [ 1e-10, (+inf) [
16408  if ( (!((TOXOVO >=1e-10))) )
16409  {
16410  UserError0(*this) << "ADMSPSP103VA: Parameter TOXOVO value " << TOXOVO << " out of range [ 1e-10, (+inf) [";
16411  }
16412 
16413  // Parameter TOXOVDO : [ 1e-10, (+inf) [
16414  if ( (!((TOXOVDO >=1e-10))) )
16415  {
16416  UserError0(*this) << "ADMSPSP103VA: Parameter TOXOVDO value " << TOXOVDO << " out of range [ 1e-10, (+inf) [";
16417  }
16418 
16419  // Parameter LOV : [ 0.0, (+inf) [
16420  if ( (!((LOV >=0.0))) )
16421  {
16422  UserError0(*this) << "ADMSPSP103VA: Parameter LOV value " << LOV << " out of range [ 0.0, (+inf) [";
16423  }
16424 
16425  // Parameter LOVD : [ 0.0, (+inf) [
16426  if ( (!((LOVD >=0.0))) )
16427  {
16428  UserError0(*this) << "ADMSPSP103VA: Parameter LOVD value " << LOVD << " out of range [ 0.0, (+inf) [";
16429  }
16430 
16431  // Parameter LP1 : [ 1e-10, (+inf) [
16432  if ( (!((LP1 >=1e-10))) )
16433  {
16434  UserError0(*this) << "ADMSPSP103VA: Parameter LP1 value " << LP1 << " out of range [ 1e-10, (+inf) [";
16435  }
16436 
16437  // Parameter LP2 : [ 1e-10, (+inf) [
16438  if ( (!((LP2 >=1e-10))) )
16439  {
16440  UserError0(*this) << "ADMSPSP103VA: Parameter LP2 value " << LP2 << " out of range [ 1e-10, (+inf) [";
16441  }
16442 
16443  // Parameter WBET : [ 1e-10, (+inf) [
16444  if ( (!((WBET >=1e-10))) )
16445  {
16446  UserError0(*this) << "ADMSPSP103VA: Parameter WBET value " << WBET << " out of range [ 1e-10, (+inf) [";
16447  }
16448 
16449  // Parameter AXL : [ 0.0, (+inf) [
16450  if ( (!((AXL >=0.0))) )
16451  {
16452  UserError0(*this) << "ADMSPSP103VA: Parameter AXL value " << AXL << " out of range [ 0.0, (+inf) [";
16453  }
16454 
16455  // Parameter ALP1L2 : [ 0.0, (+inf) [
16456  if ( (!((ALP1L2 >=0.0))) )
16457  {
16458  UserError0(*this) << "ADMSPSP103VA: Parameter ALP1L2 value " << ALP1L2 << " out of range [ 0.0, (+inf) [";
16459  }
16460 
16461  // Parameter ALP2L2 : [ 0.0, (+inf) [
16462  if ( (!((ALP2L2 >=0.0))) )
16463  {
16464  UserError0(*this) << "ADMSPSP103VA: Parameter ALP2L2 value " << ALP2L2 << " out of range [ 0.0, (+inf) [";
16465  }
16466 
16467  // Parameter RINT : [ 0.0, (+inf) [
16468  if ( (!((RINT >=0.0))) )
16469  {
16470  UserError0(*this) << "ADMSPSP103VA: Parameter RINT value " << RINT << " out of range [ 0.0, (+inf) [";
16471  }
16472 
16473  // Parameter RVPOLY : [ 0.0, (+inf) [
16474  if ( (!((RVPOLY >=0.0))) )
16475  {
16476  UserError0(*this) << "ADMSPSP103VA: Parameter RVPOLY value " << RVPOLY << " out of range [ 0.0, (+inf) [";
16477  }
16478 
16479  // Parameter RSHG : [ 0.0, (+inf) [
16480  if ( (!((RSHG >=0.0))) )
16481  {
16482  UserError0(*this) << "ADMSPSP103VA: Parameter RSHG value " << RSHG << " out of range [ 0.0, (+inf) [";
16483  }
16484 
16485  // Parameter SAREF : [ 1e-9, (+inf) [
16486  if ( (!((SAREF >=1e-9))) )
16487  {
16488  UserError0(*this) << "ADMSPSP103VA: Parameter SAREF value " << SAREF << " out of range [ 1e-9, (+inf) [";
16489  }
16490 
16491  // Parameter SBREF : [ 1e-9, (+inf) [
16492  if ( (!((SBREF >=1e-9))) )
16493  {
16494  UserError0(*this) << "ADMSPSP103VA: Parameter SBREF value " << SBREF << " out of range [ 1e-9, (+inf) [";
16495  }
16496 
16497  // Parameter KVSAT : [ (-1.0), 1.0 ]
16498  if ( (!((KVSAT >=(-1.0) && KVSAT <=1.0 ))) )
16499  {
16500  UserError0(*this) << "ADMSPSP103VA: Parameter KVSAT value " << KVSAT << " out of range [ (-1.0), 1.0 ]";
16501  }
16502 
16503  // Parameter LLODKUO : [ 0.0, (+inf) [
16504  if ( (!((LLODKUO >=0.0))) )
16505  {
16506  UserError0(*this) << "ADMSPSP103VA: Parameter LLODKUO value " << LLODKUO << " out of range [ 0.0, (+inf) [";
16507  }
16508 
16509  // Parameter WLODKUO : [ 0.0, (+inf) [
16510  if ( (!((WLODKUO >=0.0))) )
16511  {
16512  UserError0(*this) << "ADMSPSP103VA: Parameter WLODKUO value " << WLODKUO << " out of range [ 0.0, (+inf) [";
16513  }
16514 
16515  // Parameter LLODVTH : [ 0.0, (+inf) [
16516  if ( (!((LLODVTH >=0.0))) )
16517  {
16518  UserError0(*this) << "ADMSPSP103VA: Parameter LLODVTH value " << LLODVTH << " out of range [ 0.0, (+inf) [";
16519  }
16520 
16521  // Parameter WLODVTH : [ 0.0, (+inf) [
16522  if ( (!((WLODVTH >=0.0))) )
16523  {
16524  UserError0(*this) << "ADMSPSP103VA: Parameter WLODVTH value " << WLODVTH << " out of range [ 0.0, (+inf) [";
16525  }
16526 
16527  // Parameter LODETAO : [ 0.0, (+inf) [
16528  if ( (!((LODETAO >=0.0))) )
16529  {
16530  UserError0(*this) << "ADMSPSP103VA: Parameter LODETAO value " << LODETAO << " out of range [ 0.0, (+inf) [";
16531  }
16532 
16533  // Parameter SCREF : [ 0.0, (+inf) [
16534  if ( (!((SCREF >=0.0))) )
16535  {
16536  UserError0(*this) << "ADMSPSP103VA: Parameter SCREF value " << SCREF << " out of range [ 0.0, (+inf) [";
16537  }
16538 
16539  // Parameter IMAX : [ 1E-12, (+inf) [
16540  if ( (!((IMAX >=1E-12))) )
16541  {
16542  UserError0(*this) << "ADMSPSP103VA: Parameter IMAX value " << IMAX << " out of range [ 1E-12, (+inf) [";
16543  }
16544 
16545  // Parameter TRJ : [ (-250), (+inf) [
16546  if ( (!((TRJ >=(-250)))) )
16547  {
16548  UserError0(*this) << "ADMSPSP103VA: Parameter TRJ value " << TRJ << " out of range [ (-250), (+inf) [";
16549  }
16550 
16551  // Parameter CJORBOT : [ 1E-12, (+inf) [
16552  if ( (!((CJORBOT >=1E-12))) )
16553  {
16554  UserError0(*this) << "ADMSPSP103VA: Parameter CJORBOT value " << CJORBOT << " out of range [ 1E-12, (+inf) [";
16555  }
16556 
16557  // Parameter CJORSTI : [ 1E-18, (+inf) [
16558  if ( (!((CJORSTI >=1E-18))) )
16559  {
16560  UserError0(*this) << "ADMSPSP103VA: Parameter CJORSTI value " << CJORSTI << " out of range [ 1E-18, (+inf) [";
16561  }
16562 
16563  // Parameter CJORGAT : [ 1E-18, (+inf) [
16564  if ( (!((CJORGAT >=1E-18))) )
16565  {
16566  UserError0(*this) << "ADMSPSP103VA: Parameter CJORGAT value " << CJORGAT << " out of range [ 1E-18, (+inf) [";
16567  }
16568 
16569  // Parameter VBIRBOT : [ 0.050, (+inf) [
16570  if ( (!((VBIRBOT >=0.050))) )
16571  {
16572  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRBOT value " << VBIRBOT << " out of range [ 0.050, (+inf) [";
16573  }
16574 
16575  // Parameter VBIRSTI : [ 0.050, (+inf) [
16576  if ( (!((VBIRSTI >=0.050))) )
16577  {
16578  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRSTI value " << VBIRSTI << " out of range [ 0.050, (+inf) [";
16579  }
16580 
16581  // Parameter VBIRGAT : [ 0.050, (+inf) [
16582  if ( (!((VBIRGAT >=0.050))) )
16583  {
16584  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRGAT value " << VBIRGAT << " out of range [ 0.050, (+inf) [";
16585  }
16586 
16587  // Parameter PBOT : [ 0.05, 0.95 ]
16588  if ( (!((PBOT >=0.05 && PBOT <=0.95 ))) )
16589  {
16590  UserError0(*this) << "ADMSPSP103VA: Parameter PBOT value " << PBOT << " out of range [ 0.05, 0.95 ]";
16591  }
16592 
16593  // Parameter PSTI : [ 0.05, 0.95 ]
16594  if ( (!((PSTI >=0.05 && PSTI <=0.95 ))) )
16595  {
16596  UserError0(*this) << "ADMSPSP103VA: Parameter PSTI value " << PSTI << " out of range [ 0.05, 0.95 ]";
16597  }
16598 
16599  // Parameter PGAT : [ 0.05, 0.95 ]
16600  if ( (!((PGAT >=0.05 && PGAT <=0.95 ))) )
16601  {
16602  UserError0(*this) << "ADMSPSP103VA: Parameter PGAT value " << PGAT << " out of range [ 0.05, 0.95 ]";
16603  }
16604 
16605  // Parameter IDSATRBOT : [ 0, (+inf) [
16606  if ( (!((IDSATRBOT >=0))) )
16607  {
16608  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRBOT value " << IDSATRBOT << " out of range [ 0, (+inf) [";
16609  }
16610 
16611  // Parameter IDSATRSTI : [ 0, (+inf) [
16612  if ( (!((IDSATRSTI >=0))) )
16613  {
16614  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRSTI value " << IDSATRSTI << " out of range [ 0, (+inf) [";
16615  }
16616 
16617  // Parameter IDSATRGAT : [ 0, (+inf) [
16618  if ( (!((IDSATRGAT >=0))) )
16619  {
16620  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRGAT value " << IDSATRGAT << " out of range [ 0, (+inf) [";
16621  }
16622 
16623  // Parameter CSRHBOT : [ 0, (+inf) [
16624  if ( (!((CSRHBOT >=0))) )
16625  {
16626  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHBOT value " << CSRHBOT << " out of range [ 0, (+inf) [";
16627  }
16628 
16629  // Parameter CSRHSTI : [ 0, (+inf) [
16630  if ( (!((CSRHSTI >=0))) )
16631  {
16632  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHSTI value " << CSRHSTI << " out of range [ 0, (+inf) [";
16633  }
16634 
16635  // Parameter CSRHGAT : [ 0, (+inf) [
16636  if ( (!((CSRHGAT >=0))) )
16637  {
16638  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHGAT value " << CSRHGAT << " out of range [ 0, (+inf) [";
16639  }
16640 
16641  // Parameter XJUNSTI : [ 1E-9, (+inf) [
16642  if ( (!((XJUNSTI >=1E-9))) )
16643  {
16644  UserError0(*this) << "ADMSPSP103VA: Parameter XJUNSTI value " << XJUNSTI << " out of range [ 1E-9, (+inf) [";
16645  }
16646 
16647  // Parameter XJUNGAT : [ 1E-9, (+inf) [
16648  if ( (!((XJUNGAT >=1E-9))) )
16649  {
16650  UserError0(*this) << "ADMSPSP103VA: Parameter XJUNGAT value " << XJUNGAT << " out of range [ 1E-9, (+inf) [";
16651  }
16652 
16653  // Parameter CTATBOT : [ 0, (+inf) [
16654  if ( (!((CTATBOT >=0))) )
16655  {
16656  UserError0(*this) << "ADMSPSP103VA: Parameter CTATBOT value " << CTATBOT << " out of range [ 0, (+inf) [";
16657  }
16658 
16659  // Parameter CTATSTI : [ 0, (+inf) [
16660  if ( (!((CTATSTI >=0))) )
16661  {
16662  UserError0(*this) << "ADMSPSP103VA: Parameter CTATSTI value " << CTATSTI << " out of range [ 0, (+inf) [";
16663  }
16664 
16665  // Parameter CTATGAT : [ 0, (+inf) [
16666  if ( (!((CTATGAT >=0))) )
16667  {
16668  UserError0(*this) << "ADMSPSP103VA: Parameter CTATGAT value " << CTATGAT << " out of range [ 0, (+inf) [";
16669  }
16670 
16671  // Parameter MEFFTATBOT : [ 0.01, (+inf) [
16672  if ( (!((MEFFTATBOT >=0.01))) )
16673  {
16674  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATBOT value " << MEFFTATBOT << " out of range [ 0.01, (+inf) [";
16675  }
16676 
16677  // Parameter MEFFTATSTI : [ 0.01, (+inf) [
16678  if ( (!((MEFFTATSTI >=0.01))) )
16679  {
16680  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATSTI value " << MEFFTATSTI << " out of range [ 0.01, (+inf) [";
16681  }
16682 
16683  // Parameter MEFFTATGAT : [ 0.01, (+inf) [
16684  if ( (!((MEFFTATGAT >=0.01))) )
16685  {
16686  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATGAT value " << MEFFTATGAT << " out of range [ 0.01, (+inf) [";
16687  }
16688 
16689  // Parameter CBBTBOT : [ 0, (+inf) [
16690  if ( (!((CBBTBOT >=0))) )
16691  {
16692  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTBOT value " << CBBTBOT << " out of range [ 0, (+inf) [";
16693  }
16694 
16695  // Parameter CBBTSTI : [ 0, (+inf) [
16696  if ( (!((CBBTSTI >=0))) )
16697  {
16698  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTSTI value " << CBBTSTI << " out of range [ 0, (+inf) [";
16699  }
16700 
16701  // Parameter CBBTGAT : [ 0, (+inf) [
16702  if ( (!((CBBTGAT >=0))) )
16703  {
16704  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTGAT value " << CBBTGAT << " out of range [ 0, (+inf) [";
16705  }
16706 
16707  // Parameter VBRBOT : [ 0.1, (+inf) [
16708  if ( (!((VBRBOT >=0.1))) )
16709  {
16710  UserError0(*this) << "ADMSPSP103VA: Parameter VBRBOT value " << VBRBOT << " out of range [ 0.1, (+inf) [";
16711  }
16712 
16713  // Parameter VBRSTI : [ 0.1, (+inf) [
16714  if ( (!((VBRSTI >=0.1))) )
16715  {
16716  UserError0(*this) << "ADMSPSP103VA: Parameter VBRSTI value " << VBRSTI << " out of range [ 0.1, (+inf) [";
16717  }
16718 
16719  // Parameter VBRGAT : [ 0.1, (+inf) [
16720  if ( (!((VBRGAT >=0.1))) )
16721  {
16722  UserError0(*this) << "ADMSPSP103VA: Parameter VBRGAT value " << VBRGAT << " out of range [ 0.1, (+inf) [";
16723  }
16724 
16725  // Parameter PBRBOT : [ 0.1, (+inf) [
16726  if ( (!((PBRBOT >=0.1))) )
16727  {
16728  UserError0(*this) << "ADMSPSP103VA: Parameter PBRBOT value " << PBRBOT << " out of range [ 0.1, (+inf) [";
16729  }
16730 
16731  // Parameter PBRSTI : [ 0.1, (+inf) [
16732  if ( (!((PBRSTI >=0.1))) )
16733  {
16734  UserError0(*this) << "ADMSPSP103VA: Parameter PBRSTI value " << PBRSTI << " out of range [ 0.1, (+inf) [";
16735  }
16736 
16737  // Parameter PBRGAT : [ 0.1, (+inf) [
16738  if ( (!((PBRGAT >=0.1))) )
16739  {
16740  UserError0(*this) << "ADMSPSP103VA: Parameter PBRGAT value " << PBRGAT << " out of range [ 0.1, (+inf) [";
16741  }
16742 
16743  // Parameter CJORBOTD : [ 1E-12, (+inf) [
16744  if ( (!((CJORBOTD >=1E-12))) )
16745  {
16746  UserError0(*this) << "ADMSPSP103VA: Parameter CJORBOTD value " << CJORBOTD << " out of range [ 1E-12, (+inf) [";
16747  }
16748 
16749  // Parameter CJORSTID : [ 1E-18, (+inf) [
16750  if ( (!((CJORSTID >=1E-18))) )
16751  {
16752  UserError0(*this) << "ADMSPSP103VA: Parameter CJORSTID value " << CJORSTID << " out of range [ 1E-18, (+inf) [";
16753  }
16754 
16755  // Parameter CJORGATD : [ 1E-18, (+inf) [
16756  if ( (!((CJORGATD >=1E-18))) )
16757  {
16758  UserError0(*this) << "ADMSPSP103VA: Parameter CJORGATD value " << CJORGATD << " out of range [ 1E-18, (+inf) [";
16759  }
16760 
16761  // Parameter VBIRBOTD : [ 0.050, (+inf) [
16762  if ( (!((VBIRBOTD >=0.050))) )
16763  {
16764  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRBOTD value " << VBIRBOTD << " out of range [ 0.050, (+inf) [";
16765  }
16766 
16767  // Parameter VBIRSTID : [ 0.050, (+inf) [
16768  if ( (!((VBIRSTID >=0.050))) )
16769  {
16770  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRSTID value " << VBIRSTID << " out of range [ 0.050, (+inf) [";
16771  }
16772 
16773  // Parameter VBIRGATD : [ 0.050, (+inf) [
16774  if ( (!((VBIRGATD >=0.050))) )
16775  {
16776  UserError0(*this) << "ADMSPSP103VA: Parameter VBIRGATD value " << VBIRGATD << " out of range [ 0.050, (+inf) [";
16777  }
16778 
16779  // Parameter PBOTD : [ 0.05, 0.95 ]
16780  if ( (!((PBOTD >=0.05 && PBOTD <=0.95 ))) )
16781  {
16782  UserError0(*this) << "ADMSPSP103VA: Parameter PBOTD value " << PBOTD << " out of range [ 0.05, 0.95 ]";
16783  }
16784 
16785  // Parameter PSTID : [ 0.05, 0.95 ]
16786  if ( (!((PSTID >=0.05 && PSTID <=0.95 ))) )
16787  {
16788  UserError0(*this) << "ADMSPSP103VA: Parameter PSTID value " << PSTID << " out of range [ 0.05, 0.95 ]";
16789  }
16790 
16791  // Parameter PGATD : [ 0.05, 0.95 ]
16792  if ( (!((PGATD >=0.05 && PGATD <=0.95 ))) )
16793  {
16794  UserError0(*this) << "ADMSPSP103VA: Parameter PGATD value " << PGATD << " out of range [ 0.05, 0.95 ]";
16795  }
16796 
16797  // Parameter IDSATRBOTD : [ 0, (+inf) [
16798  if ( (!((IDSATRBOTD >=0))) )
16799  {
16800  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRBOTD value " << IDSATRBOTD << " out of range [ 0, (+inf) [";
16801  }
16802 
16803  // Parameter IDSATRSTID : [ 0, (+inf) [
16804  if ( (!((IDSATRSTID >=0))) )
16805  {
16806  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRSTID value " << IDSATRSTID << " out of range [ 0, (+inf) [";
16807  }
16808 
16809  // Parameter IDSATRGATD : [ 0, (+inf) [
16810  if ( (!((IDSATRGATD >=0))) )
16811  {
16812  UserError0(*this) << "ADMSPSP103VA: Parameter IDSATRGATD value " << IDSATRGATD << " out of range [ 0, (+inf) [";
16813  }
16814 
16815  // Parameter CSRHBOTD : [ 0, (+inf) [
16816  if ( (!((CSRHBOTD >=0))) )
16817  {
16818  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHBOTD value " << CSRHBOTD << " out of range [ 0, (+inf) [";
16819  }
16820 
16821  // Parameter CSRHSTID : [ 0, (+inf) [
16822  if ( (!((CSRHSTID >=0))) )
16823  {
16824  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHSTID value " << CSRHSTID << " out of range [ 0, (+inf) [";
16825  }
16826 
16827  // Parameter CSRHGATD : [ 0, (+inf) [
16828  if ( (!((CSRHGATD >=0))) )
16829  {
16830  UserError0(*this) << "ADMSPSP103VA: Parameter CSRHGATD value " << CSRHGATD << " out of range [ 0, (+inf) [";
16831  }
16832 
16833  // Parameter XJUNSTID : [ 1E-9, (+inf) [
16834  if ( (!((XJUNSTID >=1E-9))) )
16835  {
16836  UserError0(*this) << "ADMSPSP103VA: Parameter XJUNSTID value " << XJUNSTID << " out of range [ 1E-9, (+inf) [";
16837  }
16838 
16839  // Parameter XJUNGATD : [ 1E-9, (+inf) [
16840  if ( (!((XJUNGATD >=1E-9))) )
16841  {
16842  UserError0(*this) << "ADMSPSP103VA: Parameter XJUNGATD value " << XJUNGATD << " out of range [ 1E-9, (+inf) [";
16843  }
16844 
16845  // Parameter CTATBOTD : [ 0, (+inf) [
16846  if ( (!((CTATBOTD >=0))) )
16847  {
16848  UserError0(*this) << "ADMSPSP103VA: Parameter CTATBOTD value " << CTATBOTD << " out of range [ 0, (+inf) [";
16849  }
16850 
16851  // Parameter CTATSTID : [ 0, (+inf) [
16852  if ( (!((CTATSTID >=0))) )
16853  {
16854  UserError0(*this) << "ADMSPSP103VA: Parameter CTATSTID value " << CTATSTID << " out of range [ 0, (+inf) [";
16855  }
16856 
16857  // Parameter CTATGATD : [ 0, (+inf) [
16858  if ( (!((CTATGATD >=0))) )
16859  {
16860  UserError0(*this) << "ADMSPSP103VA: Parameter CTATGATD value " << CTATGATD << " out of range [ 0, (+inf) [";
16861  }
16862 
16863  // Parameter MEFFTATBOTD : [ 0.01, (+inf) [
16864  if ( (!((MEFFTATBOTD >=0.01))) )
16865  {
16866  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATBOTD value " << MEFFTATBOTD << " out of range [ 0.01, (+inf) [";
16867  }
16868 
16869  // Parameter MEFFTATSTID : [ 0.01, (+inf) [
16870  if ( (!((MEFFTATSTID >=0.01))) )
16871  {
16872  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATSTID value " << MEFFTATSTID << " out of range [ 0.01, (+inf) [";
16873  }
16874 
16875  // Parameter MEFFTATGATD : [ 0.01, (+inf) [
16876  if ( (!((MEFFTATGATD >=0.01))) )
16877  {
16878  UserError0(*this) << "ADMSPSP103VA: Parameter MEFFTATGATD value " << MEFFTATGATD << " out of range [ 0.01, (+inf) [";
16879  }
16880 
16881  // Parameter CBBTBOTD : [ 0, (+inf) [
16882  if ( (!((CBBTBOTD >=0))) )
16883  {
16884  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTBOTD value " << CBBTBOTD << " out of range [ 0, (+inf) [";
16885  }
16886 
16887  // Parameter CBBTSTID : [ 0, (+inf) [
16888  if ( (!((CBBTSTID >=0))) )
16889  {
16890  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTSTID value " << CBBTSTID << " out of range [ 0, (+inf) [";
16891  }
16892 
16893  // Parameter CBBTGATD : [ 0, (+inf) [
16894  if ( (!((CBBTGATD >=0))) )
16895  {
16896  UserError0(*this) << "ADMSPSP103VA: Parameter CBBTGATD value " << CBBTGATD << " out of range [ 0, (+inf) [";
16897  }
16898 
16899  // Parameter VBRBOTD : [ 0.1, (+inf) [
16900  if ( (!((VBRBOTD >=0.1))) )
16901  {
16902  UserError0(*this) << "ADMSPSP103VA: Parameter VBRBOTD value " << VBRBOTD << " out of range [ 0.1, (+inf) [";
16903  }
16904 
16905  // Parameter VBRSTID : [ 0.1, (+inf) [
16906  if ( (!((VBRSTID >=0.1))) )
16907  {
16908  UserError0(*this) << "ADMSPSP103VA: Parameter VBRSTID value " << VBRSTID << " out of range [ 0.1, (+inf) [";
16909  }
16910 
16911  // Parameter VBRGATD : [ 0.1, (+inf) [
16912  if ( (!((VBRGATD >=0.1))) )
16913  {
16914  UserError0(*this) << "ADMSPSP103VA: Parameter VBRGATD value " << VBRGATD << " out of range [ 0.1, (+inf) [";
16915  }
16916 
16917  // Parameter PBRBOTD : [ 0.1, (+inf) [
16918  if ( (!((PBRBOTD >=0.1))) )
16919  {
16920  UserError0(*this) << "ADMSPSP103VA: Parameter PBRBOTD value " << PBRBOTD << " out of range [ 0.1, (+inf) [";
16921  }
16922 
16923  // Parameter PBRSTID : [ 0.1, (+inf) [
16924  if ( (!((PBRSTID >=0.1))) )
16925  {
16926  UserError0(*this) << "ADMSPSP103VA: Parameter PBRSTID value " << PBRSTID << " out of range [ 0.1, (+inf) [";
16927  }
16928 
16929  // Parameter PBRGATD : [ 0.1, (+inf) [
16930  if ( (!((PBRGATD >=0.1))) )
16931  {
16932  UserError0(*this) << "ADMSPSP103VA: Parameter PBRGATD value " << PBRGATD << " out of range [ 0.1, (+inf) [";
16933  }
16934 
16935  // Parameter SWJUNEXP : [ 0.0, 1.0 ]
16936  if ( (!((SWJUNEXP >=0.0 && SWJUNEXP <=1.0 ))) )
16937  {
16938  UserError0(*this) << "ADMSPSP103VA: Parameter SWJUNEXP value " << SWJUNEXP << " out of range [ 0.0, 1.0 ]";
16939  }
16940 
16941  // Parameter VJUNREF : [ 0.5, (+inf) [
16942  if ( (!((VJUNREF >=0.5))) )
16943  {
16944  UserError0(*this) << "ADMSPSP103VA: Parameter VJUNREF value " << VJUNREF << " out of range [ 0.5, (+inf) [";
16945  }
16946 
16947  // Parameter FJUNQ : [ 0.0, (+inf) [
16948  if ( (!((FJUNQ >=0.0))) )
16949  {
16950  UserError0(*this) << "ADMSPSP103VA: Parameter FJUNQ value " << FJUNQ << " out of range [ 0.0, (+inf) [";
16951  }
16952 
16953  // Parameter VJUNREFD : [ 0.5, (+inf) [
16954  if ( (!((VJUNREFD >=0.5))) )
16955  {
16956  UserError0(*this) << "ADMSPSP103VA: Parameter VJUNREFD value " << VJUNREFD << " out of range [ 0.5, (+inf) [";
16957  }
16958 
16959  // Parameter FJUNQD : [ 0.0, (+inf) [
16960  if ( (!((FJUNQD >=0.0))) )
16961  {
16962  UserError0(*this) << "ADMSPSP103VA: Parameter FJUNQD value " << FJUNQD << " out of range [ 0.0, (+inf) [";
16963  }
16964 
16965 
16966  // and of course, this routine is where we should put the initial_model
16967  // stuff
16968  double deltaphigd;
16969  double deltaphigr;
16970  double phitrinv;
16971  double KBOL_over_QELE;
16972  double auxt;
16973  double tkd;
16974  double tkr;
16975  double TRJ_i;
16976  double TKD_sq;
16977  double TKR;
16978  double TR_i;
16979  //Begin block initial_model
16980  {
16981  if ((TYPE>=0))
16982  {
16983  CHNL_TYPE = (+1);
16984  }
16985  else
16986  {
16987  CHNL_TYPE = (-1);
16988  }
16989  SWGEO_i = floor((((SWGEO>0.0)?((SWGEO<2.0)?SWGEO:2.0):0.0)+0.5));
16990  SWIGATE_i = floor((((SWIGATE>0.0)?((SWIGATE<1.0)?SWIGATE:1.0):0.0)+0.5));
16991  SWIMPACT_i = floor((((SWIMPACT>0.0)?((SWIMPACT<1.0)?SWIMPACT:1.0):0.0)+0.5));
16992  SWGIDL_i = floor((((SWGIDL>0.0)?((SWGIDL<1.0)?SWGIDL:1.0):0.0)+0.5));
16993  SWJUNCAP_i = floor((((SWJUNCAP>0.0)?((SWJUNCAP<3.0)?SWJUNCAP:3.0):0.0)+0.5));
16994  SWJUNASYM_i = floor((((SWJUNASYM>0.0)?((SWJUNASYM<1.0)?SWJUNASYM:1.0):0.0)+0.5));
16995  SWNUD_i = floor((((SWNUD>0.0)?((SWNUD<2.0)?SWNUD:2.0):0.0)+0.5));
16996  SWDELVTAC_i = floor((((SWDELVTAC>0.0)?((SWDELVTAC<1.0)?SWDELVTAC:1.0):0.0)+0.5));
16997  QMC_i = ((QMC>0.0)?QMC:0.0);
16998  TOXO_i = ((TOXO>1e-10)?TOXO:1e-10);
16999  EPSROXO_i = ((EPSROXO>1.0)?EPSROXO:1.0);
17000  NSUBO_i = ((NSUBO>1e20)?NSUBO:1e20);
17001  WSEG_i = ((WSEG>1e-10)?WSEG:1e-10);
17002  NPCK_i = ((NPCK>0.0)?NPCK:0.0);
17003  WSEGP_i = ((WSEGP>1e-10)?WSEGP:1e-10);
17004  LPCK_i = ((LPCK>1e-10)?LPCK:1e-10);
17005  TOXOVO_i = ((TOXOVO>1e-10)?TOXOVO:1e-10);
17006  TOXOVDO_i = ((TOXOVDO>1e-10)?TOXOVDO:1e-10);
17007  LOV_i = ((LOV>0.0)?LOV:0.0);
17008  LOVD_i = ((LOVD>0.0)?LOVD:0.0);
17009  LP1_i = ((LP1>1e-10)?LP1:1e-10);
17010  LP2_i = ((LP2>1e-10)?LP2:1e-10);
17011  WBET_i = ((WBET>1e-10)?WBET:1e-10);
17012  AXL_i = ((AXL>0.0)?AXL:0.0);
17013  ALP1L2_i = ((ALP1L2>0.0)?ALP1L2:0.0);
17014  ALP2L2_i = ((ALP2L2>0.0)?ALP2L2:0.0);
17015  SAREF_i = ((SAREF>1e-9)?SAREF:1e-9);
17016  SBREF_i = ((SBREF>1e-9)?SBREF:1e-9);
17017  KVSAT_i = ((KVSAT>(-1.0))?((KVSAT<1.0)?KVSAT:1.0):(-1.0));
17018  LLODKUO_i = ((LLODKUO>0.0)?LLODKUO:0.0);
17019  WLODKUO_i = ((WLODKUO>0.0)?WLODKUO:0.0);
17020  LLODVTH_i = ((LLODVTH>0.0)?LLODVTH:0.0);
17021  WLODVTH_i = ((WLODVTH>0.0)?WLODVTH:0.0);
17022  LODETAO_i = ((LODETAO>0.0)?LODETAO:0.0);
17023  SCREF_i = ((SCREF>0.0)?SCREF:0.0);
17024  WEB_i = WEB;
17025  WEC_i = WEC;
17026  RSHG_i = ((RSHG>0.0)?RSHG:0.0);
17027  RSH_i = ((RSH>0.0)?RSH:0.0);
17028  RSHD_i = ((RSHD>0.0)?RSHD:0.0);
17029  RINT_i = ((RINT>0.0)?RINT:0.0);
17030  RVPOLY_i = ((RVPOLY>0.0)?RVPOLY:0.0);
17031  TR_i = ((TR>(-273))?TR:(-273));
17032  TKR = (273.15+TR_i);
17033  TKD = (admsModTemp+DTA);
17034  TKD_sq = (TKD*TKD);
17035  dT = (TKD-TKR);
17036  rT = (TKD/TKR);
17037  rTn = (TKR/TKD);
17038  phit = ((TKD*1.3806505E-23)/1.6021918E-19);
17039  inv_phit = (1.0/phit);
17040  Eg = ((1.179-(9.025e-5*TKD))-(3.05e-7*TKD_sq));
17041  phibFac = ((((1.045+(4.5e-4*TKD))*((0.523+(1.4e-3*TKD))-(1.48e-6*TKD_sq)))*TKD_sq)/9.0E4);
17042  phibFac = ((phibFac>1.0E-3)?phibFac:1.0E-3);
17043  EPSSI = (8.8541878176E-12*11.8);
17044  nt0 = ((4*1.3806505E-23)*TKD);
17045  TRJ_i = ((TRJ>(-250))?TRJ:(-250));
17046  IMAX_i = ((IMAX>1E-12)?IMAX:1E-12);
17047  CJORBOT_i = ((CJORBOT>1E-12)?CJORBOT:1E-12);
17048  CJORSTI_i = ((CJORSTI>1E-18)?CJORSTI:1E-18);
17049  CJORGAT_i = ((CJORGAT>1E-18)?CJORGAT:1E-18);
17050  VBIRBOT_i = ((VBIRBOT>0.050)?VBIRBOT:0.050);
17051  VBIRSTI_i = ((VBIRSTI>0.050)?VBIRSTI:0.050);
17052  VBIRGAT_i = ((VBIRGAT>0.050)?VBIRGAT:0.050);
17053  PBOT_i = ((PBOT>0.05)?((PBOT<0.95)?PBOT:0.95):0.05);
17054  PSTI_i = ((PSTI>0.05)?((PSTI<0.95)?PSTI:0.95):0.05);
17055  PGAT_i = ((PGAT>0.05)?((PGAT<0.95)?PGAT:0.95):0.05);
17056  PHIGBOT_i = PHIGBOT;
17057  PHIGSTI_i = PHIGSTI;
17058  PHIGGAT_i = PHIGGAT;
17059  IDSATRBOT_i = ((IDSATRBOT>0)?IDSATRBOT:0);
17060  IDSATRSTI_i = ((IDSATRSTI>0)?IDSATRSTI:0);
17061  IDSATRGAT_i = ((IDSATRGAT>0)?IDSATRGAT:0);
17062  CSRHBOT_i = ((CSRHBOT>0)?CSRHBOT:0);
17063  CSRHSTI_i = ((CSRHSTI>0)?CSRHSTI:0);
17064  CSRHGAT_i = ((CSRHGAT>0)?CSRHGAT:0);
17065  XJUNSTI_i = ((XJUNSTI>1E-9)?XJUNSTI:1E-9);
17066  XJUNGAT_i = ((XJUNGAT>1E-9)?XJUNGAT:1E-9);
17067  CTATBOT_i = ((CTATBOT>0)?CTATBOT:0);
17068  CTATSTI_i = ((CTATSTI>0)?CTATSTI:0);
17069  CTATGAT_i = ((CTATGAT>0)?CTATGAT:0);
17070  MEFFTATBOT_i = ((MEFFTATBOT>0.01)?MEFFTATBOT:0.01);
17071  MEFFTATSTI_i = ((MEFFTATSTI>0.01)?MEFFTATSTI:0.01);
17072  MEFFTATGAT_i = ((MEFFTATGAT>0.01)?MEFFTATGAT:0.01);
17073  CBBTBOT_i = ((CBBTBOT>0)?CBBTBOT:0);
17074  CBBTSTI_i = ((CBBTSTI>0)?CBBTSTI:0);
17075  CBBTGAT_i = ((CBBTGAT>0)?CBBTGAT:0);
17076  FBBTRBOT_i = FBBTRBOT;
17077  FBBTRSTI_i = FBBTRSTI;
17078  FBBTRGAT_i = FBBTRGAT;
17082  VBRBOT_i = ((VBRBOT>0.1)?VBRBOT:0.1);
17083  VBRSTI_i = ((VBRSTI>0.1)?VBRSTI:0.1);
17084  VBRGAT_i = ((VBRGAT>0.1)?VBRGAT:0.1);
17085  PBRBOT_i = ((PBRBOT>0.1)?PBRBOT:0.1);
17086  PBRSTI_i = ((PBRSTI>0.1)?PBRSTI:0.1);
17087  PBRGAT_i = ((PBRGAT>0.1)?PBRGAT:0.1);
17088  SWJUNEXP_i = 0.0;
17089  if ((SWJUNEXP>0.5))
17090  {
17091  SWJUNEXP_i = 1.0;
17092  }
17093  else
17094  {
17095  SWJUNEXP_i = 0.0;
17096  }
17097  VJUNREF_i = ((VJUNREF>0.5)?VJUNREF:0.5);
17098  FJUNQ_i = ((FJUNQ>0.0)?FJUNQ:0.0);
17105  PBOTS_i = PBOT_i;
17106  PSTIS_i = PSTI_i;
17107  PGATS_i = PGAT_i;
17134  VBRBOTS_i = VBRBOT_i;
17135  VBRSTIS_i = VBRSTI_i;
17136  VBRGATS_i = VBRGAT_i;
17137  PBRBOTS_i = PBRBOT_i;
17138  PBRSTIS_i = PBRSTI_i;
17139  PBRGATS_i = PBRGAT_i;
17141  FJUNQS_i = FJUNQ_i;
17142  if ((SWJUNASYM==0.0))
17143  {
17150  PBOTD_i = PBOTS_i;
17151  PSTID_i = PSTIS_i;
17152  PGATD_i = PGATS_i;
17179  VBRBOTD_i = VBRBOTS_i;
17180  VBRSTID_i = VBRSTIS_i;
17181  VBRGATD_i = VBRGATS_i;
17182  PBRBOTD_i = PBRBOTS_i;
17183  PBRSTID_i = PBRSTIS_i;
17184  PBRGATD_i = PBRGATS_i;
17186  FJUNQD_i = FJUNQS_i;
17187  }
17188  else
17189  {
17190  CJORBOTD_i = ((CJORBOTD>1E-12)?CJORBOTD:1E-12);
17191  CJORSTID_i = ((CJORSTID>1E-18)?CJORSTID:1E-18);
17192  CJORGATD_i = ((CJORGATD>1E-18)?CJORGATD:1E-18);
17193  VBIRBOTD_i = ((VBIRBOTD>0.050)?VBIRBOTD:0.050);
17194  VBIRSTID_i = ((VBIRSTID>0.050)?VBIRSTID:0.050);
17195  VBIRGATD_i = ((VBIRGATD>0.050)?VBIRGATD:0.050);
17196  PBOTD_i = ((PBOTD>0.05)?((PBOTD<0.95)?PBOTD:0.95):0.05);
17197  PSTID_i = ((PSTID>0.05)?((PSTID<0.95)?PSTID:0.95):0.05);
17198  PGATD_i = ((PGATD>0.05)?((PGATD<0.95)?PGATD:0.95):0.05);
17199  PHIGBOTD_i = PHIGBOTD;
17200  PHIGSTID_i = PHIGSTID;
17201  PHIGGATD_i = PHIGGATD;
17205  CSRHBOTD_i = ((CSRHBOTD>0)?CSRHBOTD:0);
17206  CSRHSTID_i = ((CSRHSTID>0)?CSRHSTID:0);
17207  CSRHGATD_i = ((CSRHGATD>0)?CSRHGATD:0);
17208  XJUNSTID_i = ((XJUNSTID>1E-9)?XJUNSTID:1E-9);
17209  XJUNGATD_i = ((XJUNGATD>1E-9)?XJUNGATD:1E-9);
17210  CTATBOTD_i = ((CTATBOTD>0)?CTATBOTD:0);
17211  CTATSTID_i = ((CTATSTID>0)?CTATSTID:0);
17212  CTATGATD_i = ((CTATGATD>0)?CTATGATD:0);
17213  MEFFTATBOTD_i = ((MEFFTATBOTD>0.01)?MEFFTATBOTD:0.01);
17214  MEFFTATSTID_i = ((MEFFTATSTID>0.01)?MEFFTATSTID:0.01);
17215  MEFFTATGATD_i = ((MEFFTATGATD>0.01)?MEFFTATGATD:0.01);
17216  CBBTBOTD_i = ((CBBTBOTD>0)?CBBTBOTD:0);
17217  CBBTSTID_i = ((CBBTSTID>0)?CBBTSTID:0);
17218  CBBTGATD_i = ((CBBTGATD>0)?CBBTGATD:0);
17225  VBRBOTD_i = ((VBRBOTD>0.1)?VBRBOTD:0.1);
17226  VBRSTID_i = ((VBRSTID>0.1)?VBRSTID:0.1);
17227  VBRGATD_i = ((VBRGATD>0.1)?VBRGATD:0.1);
17228  PBRBOTD_i = ((PBRBOTD>0.1)?PBRBOTD:0.1);
17229  PBRSTID_i = ((PBRSTID>0.1)?PBRSTID:0.1);
17230  PBRGATD_i = ((PBRGATD>0.1)?PBRGATD:0.1);
17231  VJUNREFD_i = ((VJUNREFD>0.5)?VJUNREFD:0.5);
17232  FJUNQD_i = ((FJUNQD>0.0)?FJUNQD:0.0);
17233  }
17234  tkr = (273.15+TRJ_i);
17235  tkd = std::max((admsModTemp+DTA),(273.15+(-250)));
17236  auxt = (tkd/tkr);
17237  KBOL_over_QELE = (1.3806505E-23/1.6021918E-19);
17238  phitr = (KBOL_over_QELE*tkr);
17239  phitrinv = (1.0/phitr);
17240  phitd = (KBOL_over_QELE*tkd);
17241  phitdinv = (1.0/phitd);
17242  deltaphigr = ((-((7.02e-4*tkr)*tkr))/(1108.0+tkr));
17243  phigrbot = (PHIGBOT_i+deltaphigr);
17244  phigrsti = (PHIGSTI_i+deltaphigr);
17245  phigrgat = (PHIGGAT_i+deltaphigr);
17246  deltaphigd = ((-((7.02e-4*tkd)*tkd))/(1108.0+tkd));
17247  phigdbot = (PHIGBOT_i+deltaphigd);
17248  phigdsti = (PHIGSTI_i+deltaphigd);
17249  phigdgat = (PHIGGAT_i+deltaphigd);
17250  ftdbot = (pow(auxt,1.5)*exp((0.5*((phigrbot*phitrinv)-(phigdbot*phitdinv)))));
17251  ftdsti = (pow(auxt,1.5)*exp((0.5*((phigrsti*phitrinv)-(phigdsti*phitdinv)))));
17252  ftdgat = (pow(auxt,1.5)*exp((0.5*((phigrgat*phitrinv)-(phigdgat*phitdinv)))));
17256  ubibot = ((VBIRBOT_i*auxt)-((2*phitd)*log(ftdbot)));
17257  ubisti = ((VBIRSTI_i*auxt)-((2*phitd)*log(ftdsti)));
17258  ubigat = ((VBIRGAT_i*auxt)-((2*phitd)*log(ftdgat)));
17259  vbibot = (ubibot+(phitd*log((1+exp(((0.050-ubibot)*phitdinv))))));
17260  vbisti = (ubisti+(phitd*log((1+exp(((0.050-ubisti)*phitdinv))))));
17261  vbigat = (ubigat+(phitd*log((1+exp(((0.050-ubigat)*phitdinv))))));
17262  vbiinvbot = (1.0/vbibot);
17263  vbiinvsti = (1.0/vbisti);
17264  vbiinvgat = (1.0/vbigat);
17265  one_minus_PBOT = (1-PBOT_i);
17266  one_minus_PSTI = (1-PSTI_i);
17267  one_minus_PGAT = (1-PGAT_i);
17277  qpref2bot = (2*cjobot);
17278  qpref2sti = (2*cjosti);
17279  qpref2gat = (2*cjogat);
17286  VBIRBOTinv = (1/VBIRBOT_i);
17287  VBIRSTIinv = (1/VBIRSTI_i);
17288  VBIRGATinv = (1/VBIRGAT_i);
17289  perfc = (1.77245385090551603*0.29214664);
17290  berfc = (((((-5)*0.29214664)+6)-pow(perfc,(-2)))/3);
17291  cerfc = ((1.0-0.29214664)-berfc);
17292  deltaEbot = std::max((0.5*phigdbot),phitd);
17293  deltaEsti = std::max((0.5*phigdsti),phitd);
17294  deltaEgat = std::max((0.5*phigdgat),phitd);
17298  btatpartbot = (sqrt(((((32*MEFFTATBOT_i)*9.1093826E-31)*1.6021918E-19)*((deltaEbot*deltaEbot)*deltaEbot)))/(3*1.05457168E-34));
17299  btatpartsti = (sqrt(((((32*MEFFTATSTI_i)*9.1093826E-31)*1.6021918E-19)*((deltaEsti*deltaEsti)*deltaEsti)))/(3*1.05457168E-34));
17300  btatpartgat = (sqrt(((((32*MEFFTATGAT_i)*9.1093826E-31)*1.6021918E-19)*((deltaEgat*deltaEgat)*deltaEgat)))/(3*1.05457168E-34));
17301  fbbtbot = (FBBTRBOT_i*(1+(STFBBTBOT_i*(tkd-tkr))));
17302  fbbtsti = (FBBTRSTI_i*(1+(STFBBTSTI_i*(tkd-tkr))));
17303  fbbtgat = (FBBTRGAT_i*(1+(STFBBTGAT_i*(tkd-tkr))));
17304  fbbtbot = ((fbbtbot>0)?fbbtbot:0);
17305  fbbtsti = ((fbbtsti>0)?fbbtsti:0);
17306  fbbtgat = ((fbbtgat>0)?fbbtgat:0);
17307  fstopbot = (1/(1-pow(0.999,PBRBOT_i)));
17308  fstopsti = (1/(1-pow(0.999,PBRSTI_i)));
17309  fstopgat = (1/(1-pow(0.999,PBRGAT_i)));
17310  VBRinvbot = (1/VBRBOT_i);
17311  VBRinvsti = (1/VBRSTI_i);
17312  VBRinvgat = (1/VBRGAT_i);
17313  slopebot = (((-((fstopbot*fstopbot)*pow(0.999,(PBRBOT_i-1))))*PBRBOT_i)*VBRinvbot);
17314  slopesti = (((-((fstopsti*fstopsti)*pow(0.999,(PBRSTI_i-1))))*PBRSTI_i)*VBRinvsti);
17315  slopegat = (((-((fstopgat*fstopgat)*pow(0.999,(PBRGAT_i-1))))*PBRGAT_i)*VBRinvgat);
17316  phigrbot_s = phigrbot;
17317  phigrsti_s = phigrsti;
17318  phigrgat_s = phigrgat;
17319  phigdbot_s = phigdbot;
17320  phigdsti_s = phigdsti;
17321  phigdgat_s = phigdgat;
17322  ftdbot_s = ftdbot;
17323  ftdsti_s = ftdsti;
17324  ftdgat_s = ftdgat;
17325  idsatbot_s = idsatbot;
17326  idsatsti_s = idsatsti;
17327  idsatgat_s = idsatgat;
17328  ubibot_s = ubibot;
17329  ubisti_s = ubisti;
17330  ubigat_s = ubigat;
17331  vbibot_s = vbibot;
17332  vbisti_s = vbisti;
17333  vbigat_s = vbigat;
17343  cjobot_s = cjobot;
17344  cjosti_s = cjosti;
17345  cjogat_s = cjogat;
17346  qprefbot_s = qprefbot;
17347  qprefsti_s = qprefsti;
17348  qprefgat_s = qprefgat;
17364  atatbot_s = atatbot;
17365  atatsti_s = atatsti;
17366  atatgat_s = atatgat;
17370  fbbtbot_s = fbbtbot;
17371  fbbtsti_s = fbbtsti;
17372  fbbtgat_s = fbbtgat;
17373  fbbtbot_s = fbbtbot;
17374  fbbtsti_s = fbbtsti;
17375  fbbtgat_s = fbbtgat;
17376  fstopbot_s = fstopbot;
17377  fstopsti_s = fstopsti;
17378  fstopgat_s = fstopgat;
17382  slopebot_s = slopebot;
17383  slopesti_s = slopesti;
17384  slopegat_s = slopegat;
17385  phigrbot_d = (PHIGBOTD_i+deltaphigr);
17386  phigrsti_d = (PHIGSTID_i+deltaphigr);
17387  phigrgat_d = (PHIGGATD_i+deltaphigr);
17388  phigdbot_d = (PHIGBOTD_i+deltaphigd);
17389  phigdsti_d = (PHIGSTID_i+deltaphigd);
17390  phigdgat_d = (PHIGGATD_i+deltaphigd);
17391  ftdbot_d = (pow(auxt,1.5)*exp((0.5*((phigrbot_d*phitrinv)-(phigdbot_d*phitdinv)))));
17392  ftdsti_d = (pow(auxt,1.5)*exp((0.5*((phigrsti_d*phitrinv)-(phigdsti_d*phitdinv)))));
17393  ftdgat_d = (pow(auxt,1.5)*exp((0.5*((phigrgat_d*phitrinv)-(phigdgat_d*phitdinv)))));
17397  ubibot_d = ((VBIRBOTD_i*auxt)-((2*phitd)*log(ftdbot_d)));
17398  ubisti_d = ((VBIRSTID_i*auxt)-((2*phitd)*log(ftdsti_d)));
17399  ubigat_d = ((VBIRGATD_i*auxt)-((2*phitd)*log(ftdgat_d)));
17400  vbibot_d = (ubibot_d+(phitd*log((1+exp(((0.050-ubibot_d)*phitdinv))))));
17401  vbisti_d = (ubisti_d+(phitd*log((1+exp(((0.050-ubisti_d)*phitdinv))))));
17402  vbigat_d = (ubigat_d+(phitd*log((1+exp(((0.050-ubigat_d)*phitdinv))))));
17403  vbiinvbot_d = (1.0/vbibot_d);
17404  vbiinvsti_d = (1.0/vbisti_d);
17405  vbiinvgat_d = (1.0/vbigat_d);
17406  one_minus_PBOT_d = (1-PBOTD_i);
17407  one_minus_PSTI_d = (1-PSTID_i);
17408  one_minus_PGAT_d = (1-PGATD_i);
17418  qpref2bot_d = (2*cjobot_d);
17419  qpref2sti_d = (2*cjosti_d);
17420  qpref2gat_d = (2*cjogat_d);
17427  VBIRBOTinv_d = (1/VBIRBOTD_i);
17428  VBIRSTIinv_d = (1/VBIRSTID_i);
17429  VBIRGATinv_d = (1/VBIRGATD_i);
17430  deltaEbot_d = std::max((0.5*phigdbot_d),phitd);
17431  deltaEsti_d = std::max((0.5*phigdsti_d),phitd);
17432  deltaEgat_d = std::max((0.5*phigdgat_d),phitd);
17436  btatpartbot_d = (sqrt(((((32*MEFFTATBOTD_i)*9.1093826E-31)*1.6021918E-19)*((deltaEbot_d*deltaEbot_d)*deltaEbot_d)))/(3*1.05457168E-34));
17437  btatpartsti_d = (sqrt(((((32*MEFFTATSTID_i)*9.1093826E-31)*1.6021918E-19)*((deltaEsti_d*deltaEsti_d)*deltaEsti_d)))/(3*1.05457168E-34));
17438  btatpartgat_d = (sqrt(((((32*MEFFTATGATD_i)*9.1093826E-31)*1.6021918E-19)*((deltaEgat_d*deltaEgat_d)*deltaEgat_d)))/(3*1.05457168E-34));
17439  fbbtbot_d = (FBBTRBOTD_i*(1+(STFBBTBOTD_i*(tkd-tkr))));
17440  fbbtsti_d = (FBBTRSTID_i*(1+(STFBBTSTID_i*(tkd-tkr))));
17441  fbbtgat_d = (FBBTRGATD_i*(1+(STFBBTGATD_i*(tkd-tkr))));
17442  fbbtbot_d = ((fbbtbot_d>0)?fbbtbot_d:0);
17443  fbbtsti_d = ((fbbtsti_d>0)?fbbtsti_d:0);
17444  fbbtgat_d = ((fbbtgat_d>0)?fbbtgat_d:0);
17445  fstopbot_d = (1/(1-pow(0.999,PBRBOTD_i)));
17446  fstopsti_d = (1/(1-pow(0.999,PBRSTID_i)));
17447  fstopgat_d = (1/(1-pow(0.999,PBRGATD_i)));
17448  VBRinvbot_d = (1/VBRBOTD_i);
17449  VBRinvsti_d = (1/VBRSTID_i);
17450  VBRinvgat_d = (1/VBRGATD_i);
17451  slopebot_d = (((-((fstopbot_d*fstopbot_d)*pow(0.999,(PBRBOTD_i-1))))*PBRBOTD_i)*VBRinvbot_d);
17452  slopesti_d = (((-((fstopsti_d*fstopsti_d)*pow(0.999,(PBRSTID_i-1))))*PBRSTID_i)*VBRinvsti_d);
17453  slopegat_d = (((-((fstopgat_d*fstopgat_d)*pow(0.999,(PBRGATD_i-1))))*PBRGATD_i)*VBRinvgat_d);
17454  }
17455  // End block initial_model
17456 
17457 
17458  return true;
17459 }
17460 //----------------------------------------------------------------------------
17461 // Function : Model::processInstanceParams
17462 // Purpose :
17463 // Special Notes :
17464 // Scope : public
17465 // Creator :
17466 // Creation Date :
17467 //----------------------------------------------------------------------------
17469 {
17470 
17471  std::vector<Instance*>::iterator iter;
17472  std::vector<Instance*>::iterator first = instanceContainer.begin();
17473  std::vector<Instance*>::iterator last = instanceContainer.end();
17474 
17475  for (iter=first; iter!=last; ++iter)
17476  {
17477  (*iter)->processParams();
17478  }
17479 
17480  return true;
17481 }
17482 
17483 //-----------------------------------------------------------------------------
17484 // Function : Model::Model
17485 // Purpose : model block constructor
17486 // Special Notes :
17487 // Scope : public
17488 // Creator :
17489 // Creation Date :
17490 //-----------------------------------------------------------------------------
17492  const Configuration & configuration,
17493  const ModelBlock & model_block,
17494  const FactoryBlock & factory_block)
17495  : DeviceModel(model_block, configuration.getModelParameters(), factory_block),
17496  LEVEL(103),
17497  TYPE(1.0),
17498  TR(21.0),
17499  SWGEO(1.0),
17500  SWIGATE(0.0),
17501  SWIMPACT(0.0),
17502  SWGIDL(0.0),
17503  SWJUNCAP(0.0),
17504  SWJUNASYM(0.0),
17505  SWNUD(0.0),
17506  SWDELVTAC(0.0),
17507  QMC(1.0),
17508  VFB((-1.0)),
17509  STVFB(5.0e-4),
17510  TOX(2.0e-09),
17511  EPSROX(3.9),
17512  NEFF(5.0e+23),
17513  FACNEFFAC(1.0),
17514  GFACNUD(1.0),
17515  VSBNUD(0.0),
17516  DVSBNUD(1.0),
17517  VNSUB(0.0),
17518  NSLP(0.05),
17519  DNSUB(0.0),
17520  DPHIB(0.0),
17521  DELVTAC(0.0),
17522  NP(1.0e+26),
17523  CT(0.0),
17524  TOXOV(2.0e-09),
17525  TOXOVD(2.0e-09),
17526  NOV(5.0e+25),
17527  NOVD(5.0e+25),
17528  CF(0.0),
17529  CFB(0.0),
17530  BETN(7e-2),
17531  STBET(1.0),
17532  MUE(0.5),
17533  STMUE(0.0),
17534  THEMU(1.5),
17535  STTHEMU(1.5),
17536  CS(0.0),
17537  STCS(0.0),
17538  XCOR(0.0),
17539  STXCOR(0.0),
17540  FETA(1.0),
17541  RS(30),
17542  STRS(1.0),
17543  RSB(0.0),
17544  RSG(0.0),
17545  THESAT(1.0),
17546  STTHESAT(1.0),
17547  THESATB(0.0),
17548  THESATG(0.0),
17549  AX(3.0),
17550  ALP(0.01),
17551  ALP1(0.00),
17552  ALP2(0.00),
17553  VP(0.05),
17554  A1(1.0),
17555  A2(10.0),
17556  STA2(0.0),
17557  A3(1.0),
17558  A4(0.0),
17559  GCO(0.0),
17560  IGINV(0.0),
17561  IGOV(0.0),
17562  IGOVD(0.0),
17563  STIG(2.0),
17564  GC2(0.375),
17565  GC3(0.063),
17566  CHIB(3.1),
17567  AGIDL(0.0),
17568  AGIDLD(0.0),
17569  BGIDL(41.0),
17570  BGIDLD(41.0),
17571  STBGIDL(0.0),
17572  STBGIDLD(0.0),
17573  CGIDL(0.0),
17574  CGIDLD(0.0),
17575  COX(1.0e-14),
17576  CGOV(1.0e-15),
17577  CGOVD(1.0e-15),
17578  CGBOV(0.0),
17579  CFR(0.0),
17580  CFRD(0.0),
17581  FNT(1.0),
17582  NFA(8.0e+22),
17583  NFB(3.0e+07),
17584  NFC(0.0),
17585  EF(1.0),
17586  RG(0.0),
17587  RSE(0.0),
17588  RDE(0.0),
17589  RBULK(0.0),
17590  RWELL(0.0),
17591  RJUNS(0.0),
17592  RJUND(0.0),
17593  POVFB((-1)),
17594  PLVFB(0.0),
17595  PWVFB(0.0),
17596  PLWVFB(0.0),
17597  POSTVFB(0.0005),
17598  PLSTVFB(0.0),
17599  PWSTVFB(0.0),
17600  PLWSTVFB(0.0),
17601  POTOX(2E-09),
17602  POEPSROX(3.9),
17603  PONEFF(5E+23),
17604  PLNEFF(0.0),
17605  PWNEFF(0.0),
17606  PLWNEFF(0.0),
17607  POFACNEFFAC(1.0),
17608  PLFACNEFFAC(0.0),
17609  PWFACNEFFAC(0.0),
17610  PLWFACNEFFAC(0.0),
17611  POGFACNUD(1.0),
17612  PLGFACNUD(0.0),
17613  PWGFACNUD(0.0),
17614  PLWGFACNUD(0.0),
17615  POVSBNUD(0.0),
17616  PODVSBNUD(1.0),
17617  POVNSUB(0),
17618  PONSLP(0.05),
17619  PODNSUB(0),
17620  PODPHIB(0),
17621  PLDPHIB(0.0),
17622  PWDPHIB(0.0),
17623  PLWDPHIB(0.0),
17624  PODELVTAC(0),
17625  PLDELVTAC(0.0),
17626  PWDELVTAC(0.0),
17627  PLWDELVTAC(0.0),
17628  PONP(1E+26),
17629  PLNP(0.0),
17630  PWNP(0.0),
17631  PLWNP(0.0),
17632  POCT(0),
17633  PLCT(0.0),
17634  PWCT(0.0),
17635  PLWCT(0.0),
17636  POTOXOV(2E-09),
17637  POTOXOVD(2E-09),
17638  PONOV(5E+25),
17639  PLNOV(0.0),
17640  PWNOV(0.0),
17641  PLWNOV(0.0),
17642  PONOVD(5E+25),
17643  PLNOVD(0.0),
17644  PWNOVD(0.0),
17645  PLWNOVD(0.0),
17646  POCF(0),
17647  PLCF(0.0),
17648  PWCF(0.0),
17649  PLWCF(0.0),
17650  POCFB(0),
17651  POBETN(0.07),
17652  PLBETN(0.0),
17653  PWBETN(0.0),
17654  PLWBETN(0.0),
17655  POSTBET(1),
17656  PLSTBET(0.0),
17657  PWSTBET(0.0),
17658  PLWSTBET(0.0),
17659  POMUE(0.5),
17660  PLMUE(0.0),
17661  PWMUE(0.0),
17662  PLWMUE(0.0),
17663  POSTMUE(0),
17664  POTHEMU(1.5),
17665  POSTTHEMU(1.5),
17666  POCS(0),
17667  PLCS(0.0),
17668  PWCS(0.0),
17669  PLWCS(0.0),
17670  POSTCS(0),
17671  POXCOR(0),
17672  PLXCOR(0.0),
17673  PWXCOR(0.0),
17674  PLWXCOR(0.0),
17675  POSTXCOR(0),
17676  POFETA(1),
17677  PORS(30),
17678  PLRS(0.0),
17679  PWRS(0.0),
17680  PLWRS(0.0),
17681  POSTRS(1),
17682  PORSB(0),
17683  PORSG(0),
17684  POTHESAT(1),
17685  PLTHESAT(0.0),
17686  PWTHESAT(0.0),
17687  PLWTHESAT(0.0),
17688  POSTTHESAT(1),
17689  PLSTTHESAT(0.0),
17690  PWSTTHESAT(0.0),
17691  PLWSTTHESAT(0.0),
17692  POTHESATB(0),
17693  PLTHESATB(0.0),
17694  PWTHESATB(0.0),
17695  PLWTHESATB(0.0),
17696  POTHESATG(0),
17697  PLTHESATG(0.0),
17698  PWTHESATG(0.0),
17699  PLWTHESATG(0.0),
17700  POAX(3),
17701  PLAX(0.0),
17702  PWAX(0.0),
17703  PLWAX(0.0),
17704  POALP(0.01),
17705  PLALP(0.0),
17706  PWALP(0.0),
17707  PLWALP(0.0),
17708  POALP1(0),
17709  PLALP1(0.0),
17710  PWALP1(0.0),
17711  PLWALP1(0.0),
17712  POALP2(0),
17713  PLALP2(0.0),
17714  PWALP2(0.0),
17715  PLWALP2(0.0),
17716  POVP(0.05),
17717  POA1(1),
17718  PLA1(0.0),
17719  PWA1(0.0),
17720  PLWA1(0.0),
17721  POA2(10),
17722  POSTA2(0),
17723  POA3(1),
17724  PLA3(0.0),
17725  PWA3(0.0),
17726  PLWA3(0.0),
17727  POA4(0),
17728  PLA4(0.0),
17729  PWA4(0.0),
17730  PLWA4(0.0),
17731  POGCO(0),
17732  POIGINV(0),
17733  PLIGINV(0.0),
17734  PWIGINV(0.0),
17735  PLWIGINV(0.0),
17736  POIGOV(0),
17737  PLIGOV(0.0),
17738  PWIGOV(0.0),
17739  PLWIGOV(0.0),
17740  POIGOVD(0),
17741  PLIGOVD(0.0),
17742  PWIGOVD(0.0),
17743  PLWIGOVD(0.0),
17744  POSTIG(2),
17745  POGC2(0.375),
17746  POGC3(0.063),
17747  POCHIB(3.1),
17748  POAGIDL(0),
17749  PLAGIDL(0.0),
17750  PWAGIDL(0.0),
17751  PLWAGIDL(0.0),
17752  POAGIDLD(0),
17753  PLAGIDLD(0.0),
17754  PWAGIDLD(0.0),
17755  PLWAGIDLD(0.0),
17756  POBGIDL(41),
17757  POBGIDLD(41),
17758  POSTBGIDL(0),
17759  POSTBGIDLD(0),
17760  POCGIDL(0),
17761  POCGIDLD(0),
17762  POCOX(1E-14),
17763  PLCOX(0.0),
17764  PWCOX(0.0),
17765  PLWCOX(0.0),
17766  POCGOV(1E-15),
17767  PLCGOV(0.0),
17768  PWCGOV(0.0),
17769  PLWCGOV(0.0),
17770  POCGOVD(1E-15),
17771  PLCGOVD(0.0),
17772  PWCGOVD(0.0),
17773  PLWCGOVD(0.0),
17774  POCGBOV(0),
17775  PLCGBOV(0.0),
17776  PWCGBOV(0.0),
17777  PLWCGBOV(0.0),
17778  POCFR(0),
17779  PLCFR(0.0),
17780  PWCFR(0.0),
17781  PLWCFR(0.0),
17782  POCFRD(0),
17783  PLCFRD(0.0),
17784  PWCFRD(0.0),
17785  PLWCFRD(0.0),
17786  POFNT(1),
17787  PONFA(8E+22),
17788  PLNFA(0.0),
17789  PWNFA(0.0),
17790  PLWNFA(0.0),
17791  PONFB(3E+07),
17792  PLNFB(0.0),
17793  PWNFB(0.0),
17794  PLWNFB(0.0),
17795  PONFC(0),
17796  PLNFC(0.0),
17797  PWNFC(0.0),
17798  PLWNFC(0.0),
17799  POEF(1.0),
17800  POKVTHOWE(0),
17801  PLKVTHOWE(0),
17802  PWKVTHOWE(0),
17803  PLWKVTHOWE(0),
17804  POKUOWE(0),
17805  PLKUOWE(0),
17806  PWKUOWE(0),
17807  PLWKUOWE(0),
17808  LMIN(0),
17809  LMAX(1.0),
17810  WMIN(0),
17811  WMAX(1.0),
17812  LVARO(0.0),
17813  LVARL(0.0),
17814  LVARW(0.0),
17815  LAP(0.0),
17816  WVARO(0.0),
17817  WVARL(0.0),
17818  WVARW(0.0),
17819  WOT(0.0),
17820  DLQ(0.0),
17821  DWQ(0.0),
17822  VFBO((-1.0)),
17823  VFBL(0.0),
17824  VFBW(0.0),
17825  VFBLW(0.0),
17826  STVFBO(5e-4),
17827  STVFBL(0.0),
17828  STVFBW(0.0),
17829  STVFBLW(0.0),
17830  TOXO(2e-9),
17831  EPSROXO(3.9),
17832  NSUBO(3e23),
17833  NSUBW(0.0),
17834  WSEG(1e-8),
17835  NPCK(1e24),
17836  NPCKW(0.0),
17837  WSEGP(1e-8),
17838  LPCK(1e-8),
17839  LPCKW(0.0),
17840  FOL1(0.0),
17841  FOL2(0.0),
17842  FACNEFFACO(1.0),
17843  FACNEFFACL(0.0),
17844  FACNEFFACW(0.0),
17845  FACNEFFACLW(0.0),
17846  GFACNUDO(1.0),
17847  GFACNUDL(0.0),
17848  GFACNUDLEXP(1.0),
17849  GFACNUDW(0.0),
17850  GFACNUDLW(0.0),
17851  VSBNUDO(0.0),
17852  DVSBNUDO(1.0),
17853  VNSUBO(0.0),
17854  NSLPO(0.05),
17855  DNSUBO(0.0),
17856  DPHIBO(0.0),
17857  DPHIBL(0.0),
17858  DPHIBLEXP(1.0),
17859  DPHIBW(0.0),
17860  DPHIBLW(0.0),
17861  DELVTACO(0.0),
17862  DELVTACL(0.0),
17863  DELVTACLEXP(1.0),
17864  DELVTACW(0.0),
17865  DELVTACLW(0.0),
17866  NPO(1e26),
17867  NPL(0.0),
17868  CTO(0.0),
17869  CTL(0.0),
17870  CTLEXP(1.0),
17871  CTW(0.0),
17872  CTLW(0.0),
17873  TOXOVO(2e-9),
17874  TOXOVDO(2e-9),
17875  LOV(0),
17876  LOVD(0),
17877  NOVO(5e25),
17878  NOVDO(5e25),
17879  CFL(0.0),
17880  CFLEXP(2.0),
17881  CFW(0.0),
17882  CFBO(0.0),
17883  UO(5e-2),
17884  FBET1(0.0),
17885  FBET1W(0.0),
17886  LP1(1e-8),
17887  LP1W(0.0),
17888  FBET2(0.0),
17889  LP2(1e-8),
17890  BETW1(0.0),
17891  BETW2(0.0),
17892  WBET(1e-9),
17893  STBETO(1.0),
17894  STBETL(0.0),
17895  STBETW(0.0),
17896  STBETLW(0.0),
17897  MUEO(0.5),
17898  MUEW(0.0),
17899  STMUEO(0.0),
17900  THEMUO(1.5),
17901  STTHEMUO(1.5),
17902  CSO(0.0),
17903  CSL(0.0),
17904  CSLEXP(1.0),
17905  CSW(0.0),
17906  CSLW(0.0),
17907  STCSO(0.0),
17908  XCORO(0.0),
17909  XCORL(0.0),
17910  XCORW(0.0),
17911  XCORLW(0.0),
17912  STXCORO(0.0),
17913  FETAO(1.0),
17914  RSW1(50.0),
17915  RSW2(0.0),
17916  STRSO(1.0),
17917  RSBO(0.0),
17918  RSGO(0.0),
17919  THESATO(0.0),
17920  THESATL(0.05),
17921  THESATLEXP(1.0),
17922  THESATW(0.0),
17923  THESATLW(0.0),
17924  STTHESATO(1.0),
17925  STTHESATL(0.0),
17926  STTHESATW(0.0),
17927  STTHESATLW(0.0),
17928  THESATBO(0.0),
17929  THESATGO(0.0),
17930  AXO(18),
17931  AXL(0.4),
17932  ALPL(5e-4),
17933  ALPLEXP(1.0),
17934  ALPW(0.0),
17935  ALP1L1(0.0),
17936  ALP1LEXP(0.5),
17937  ALP1L2(0.0),
17938  ALP1W(0.0),
17939  ALP2L1(0.0),
17940  ALP2LEXP(0.5),
17941  ALP2L2(0.0),
17942  ALP2W(0.0),
17943  VPO(0.05),
17944  A1O(1.0),
17945  A1L(0.0),
17946  A1W(0.0),
17947  A2O(10),
17948  STA2O(0.0),
17949  A3O(1.0),
17950  A3L(0.0),
17951  A3W(0.0),
17952  A4O(0.0),
17953  A4L(0.0),
17954  A4W(0.0),
17955  GCOO(0.0),
17956  IGINVLW(0.0),
17957  IGOVW(0.0),
17958  IGOVDW(0.0),
17959  STIGO(2.0),
17960  GC2O(0.375),
17961  GC3O(0.063),
17962  CHIBO(3.1),
17963  AGIDLW(0.0),
17964  AGIDLDW(0.0),
17965  BGIDLO(41),
17966  BGIDLDO(41),
17967  STBGIDLO(0.0),
17968  STBGIDLDO(0.0),
17969  CGIDLO(0.0),
17970  CGIDLDO(0.0),
17971  CGBOVL(0.0),
17972  CFRW(0.0),
17973  CFRDW(0.0),
17974  FNTO(1.0),
17975  NFALW(8e22),
17976  NFBLW(3e7),
17977  NFCLW(0.0),
17978  EFO(1.0),
17979  LINTNOI(0.0),
17980  ALPNOI(2.0),
17981  KVTHOWEO(0),
17982  KVTHOWEL(0),
17983  KVTHOWEW(0),
17984  KVTHOWELW(0),
17985  KUOWEO(0),
17986  KUOWEL(0),
17987  KUOWEW(0),
17988  KUOWELW(0),
17989  RGO(0.0),
17990  RINT(0.0),
17991  RVPOLY(0.0),
17992  RSHG(0.0),
17993  DLSIL(0.0),
17994  RSH(0.0),
17995  RSHD(0.0),
17996  RBULKO(0.0),
17997  RWELLO(0.0),
17998  RJUNSO(0.0),
17999  RJUNDO(0.0),
18000  SAREF(1.0e-6),
18001  SBREF(1.0e-6),
18002  WLOD(0),
18003  KUO(0),
18004  KVSAT(0),
18005  TKUO(0),
18006  LKUO(0),
18007  WKUO(0),
18008  PKUO(0),
18009  LLODKUO(0),
18010  WLODKUO(0),
18011  KVTHO(0),
18012  LKVTHO(0),
18013  WKVTHO(0),
18014  PKVTHO(0),
18015  LLODVTH(0),
18016  WLODVTH(0),
18017  STETAO(0),
18018  LODETAO(1.0),
18019  SCREF(1.0e-6),
18020  WEB(0),
18021  WEC(0),
18022  IMAX(1000),
18023  TRJ(21),
18024  CJORBOT(1E-3),
18025  CJORSTI(1E-9),
18026  CJORGAT(1E-9),
18027  VBIRBOT(1),
18028  VBIRSTI(1),
18029  VBIRGAT(1),
18030  PBOT(0.5),
18031  PSTI(0.5),
18032  PGAT(0.5),
18033  PHIGBOT(1.16),
18034  PHIGSTI(1.16),
18035  PHIGGAT(1.16),
18036  IDSATRBOT(1E-12),
18037  IDSATRSTI(1E-18),
18038  IDSATRGAT(1E-18),
18039  CSRHBOT(1E2),
18040  CSRHSTI(1E-4),
18041  CSRHGAT(1E-4),
18042  XJUNSTI(100E-9),
18043  XJUNGAT(100E-9),
18044  CTATBOT(1E2),
18045  CTATSTI(1E-4),
18046  CTATGAT(1E-4),
18047  MEFFTATBOT(0.25),
18048  MEFFTATSTI(0.25),
18049  MEFFTATGAT(0.25),
18050  CBBTBOT(1E-12),
18051  CBBTSTI(1E-18),
18052  CBBTGAT(1E-18),
18053  FBBTRBOT(1E9),
18054  FBBTRSTI(1E9),
18055  FBBTRGAT(1E9),
18056  STFBBTBOT((-1E-3)),
18057  STFBBTSTI((-1E-3)),
18058  STFBBTGAT((-1E-3)),
18059  VBRBOT(10),
18060  VBRSTI(10),
18061  VBRGAT(10),
18062  PBRBOT(4),
18063  PBRSTI(4),
18064  PBRGAT(4),
18065  CJORBOTD(1E-3),
18066  CJORSTID(1E-9),
18067  CJORGATD(1E-9),
18068  VBIRBOTD(1),
18069  VBIRSTID(1),
18070  VBIRGATD(1),
18071  PBOTD(0.5),
18072  PSTID(0.5),
18073  PGATD(0.5),
18074  PHIGBOTD(1.16),
18075  PHIGSTID(1.16),
18076  PHIGGATD(1.16),
18077  IDSATRBOTD(1E-12),
18078  IDSATRSTID(1E-18),
18079  IDSATRGATD(1E-18),
18080  CSRHBOTD(1E2),
18081  CSRHSTID(1E-4),
18082  CSRHGATD(1E-4),
18083  XJUNSTID(100E-9),
18084  XJUNGATD(100E-9),
18085  CTATBOTD(1E2),
18086  CTATSTID(1E-4),
18087  CTATGATD(1E-4),
18088  MEFFTATBOTD(0.25),
18089  MEFFTATSTID(0.25),
18090  MEFFTATGATD(0.25),
18091  CBBTBOTD(1E-12),
18092  CBBTSTID(1E-18),
18093  CBBTGATD(1E-18),
18094  FBBTRBOTD(1E9),
18095  FBBTRSTID(1E9),
18096  FBBTRGATD(1E9),
18097  STFBBTBOTD((-1E-3)),
18098  STFBBTSTID((-1E-3)),
18099  STFBBTGATD((-1E-3)),
18100  VBRBOTD(10),
18101  VBRSTID(10),
18102  VBRGATD(10),
18103  PBRBOTD(4),
18104  PBRSTID(4),
18105  PBRGATD(4),
18106  SWJUNEXP(0.0),
18107  VJUNREF(2.5),
18108  FJUNQ(0.03),
18109  VJUNREFD(2.5),
18110  FJUNQD(0.03),
18111  DTA(0.0),
18112  NSUBO_i(0.0),
18113  WSEG_i(0.0),
18114  NPCK_i(0.0),
18115  WSEGP_i(0.0),
18116  LPCK_i(0.0),
18117  LOV_i(0.0),
18118  LOVD_i(0.0),
18119  LP1_i(0.0),
18120  LP2_i(0.0),
18121  WBET_i(0.0),
18122  AXL_i(0.0),
18123  ALP1L2_i(0.0),
18124  ALP2L2_i(0.0),
18125  TOXO_i(0.0),
18126  TOXOVO_i(0.0),
18127  TOXOVDO_i(0.0),
18128  EPSROXO_i(0.0),
18129  RINT_i(0.0),
18130  RVPOLY_i(0.0),
18131  RSHG_i(0.0),
18132  RSH_i(0.0),
18133  RSHD_i(0.0),
18134  SAREF_i(0.0),
18135  SBREF_i(0.0),
18136  KVSAT_i(0.0),
18137  LLODKUO_i(0.0),
18138  WLODKUO_i(0.0),
18139  LLODVTH_i(0.0),
18140  WLODVTH_i(0.0),
18141  LODETAO_i(0.0),
18142  SCREF_i(0.0),
18143  WEB_i(0.0),
18144  WEC_i(0.0),
18145  QMC_i(0.0),
18146  TKD(0.0),
18147  dT(0.0),
18148  rT(0.0),
18149  rTn(0.0),
18150  EPSSI(0.0),
18151  phit(0.0),
18152  inv_phit(0.0),
18153  Eg(0.0),
18154  phibFac(0.0),
18155  nt0(0.0),
18156  CHNL_TYPE(0),
18157  SWGEO_i(0),
18158  SWIGATE_i(0),
18159  SWIMPACT_i(0),
18160  SWGIDL_i(0),
18161  SWJUNCAP_i(0),
18162  SWJUNASYM_i(0),
18163  SWNUD_i(0),
18164  SWDELVTAC_i(0),
18165  IMAX_i(0.0),
18166  CJORBOT_i(0.0),
18167  CJORSTI_i(0.0),
18168  CJORGAT_i(0.0),
18169  VBIRBOT_i(0.0),
18170  VBIRSTI_i(0.0),
18171  VBIRGAT_i(0.0),
18172  PBOT_i(0.0),
18173  PSTI_i(0.0),
18174  PGAT_i(0.0),
18175  PHIGBOT_i(0.0),
18176  PHIGSTI_i(0.0),
18177  PHIGGAT_i(0.0),
18178  IDSATRBOT_i(0.0),
18179  IDSATRSTI_i(0.0),
18180  IDSATRGAT_i(0.0),
18181  XJUNSTI_i(0.0),
18182  XJUNGAT_i(0.0),
18183  CSRHBOT_i(0.0),
18184  CSRHSTI_i(0.0),
18185  CSRHGAT_i(0.0),
18186  CTATBOT_i(0.0),
18187  CTATSTI_i(0.0),
18188  CTATGAT_i(0.0),
18189  MEFFTATBOT_i(0.0),
18190  MEFFTATSTI_i(0.0),
18191  MEFFTATGAT_i(0.0),
18192  CBBTBOT_i(0.0),
18193  CBBTSTI_i(0.0),
18194  CBBTGAT_i(0.0),
18195  FBBTRBOT_i(0.0),
18196  FBBTRSTI_i(0.0),
18197  FBBTRGAT_i(0.0),
18198  STFBBTBOT_i(0.0),
18199  STFBBTSTI_i(0.0),
18200  STFBBTGAT_i(0.0),
18201  VBRBOT_i(0.0),
18202  VBRSTI_i(0.0),
18203  VBRGAT_i(0.0),
18204  PBRBOT_i(0.0),
18205  PBRSTI_i(0.0),
18206  PBRGAT_i(0.0),
18207  SWJUNEXP_i(0.0),
18208  VJUNREF_i(0.0),
18209  FJUNQ_i(0.0),
18210  phitr(0.0),
18211  phitd(0.0),
18212  phitdinv(0.0),
18213  perfc(0.0),
18214  berfc(0.0),
18215  cerfc(0.0),
18216  phigrbot(0.0),
18217  phigrsti(0.0),
18218  phigrgat(0.0),
18219  phigdbot(0.0),
18220  phigdsti(0.0),
18221  phigdgat(0.0),
18222  ftdbot(0.0),
18223  ftdsti(0.0),
18224  ftdgat(0.0),
18225  idsatbot(0.0),
18226  idsatsti(0.0),
18227  idsatgat(0.0),
18228  ubibot(0.0),
18229  ubisti(0.0),
18230  ubigat(0.0),
18231  vbibot(0.0),
18232  vbisti(0.0),
18233  vbigat(0.0),
18234  vbiinvbot(0.0),
18235  vbiinvsti(0.0),
18236  vbiinvgat(0.0),
18237  one_minus_PBOT(0.0),
18238  one_minus_PSTI(0.0),
18239  one_minus_PGAT(0.0),
18240  one_over_one_minus_PBOT(0.0),
18241  one_over_one_minus_PSTI(0.0),
18242  one_over_one_minus_PGAT(0.0),
18243  cjobot(0.0),
18244  cjosti(0.0),
18245  cjogat(0.0),
18246  qprefbot(0.0),
18247  qprefsti(0.0),
18248  qprefgat(0.0),
18249  qpref2bot(0.0),
18250  qpref2sti(0.0),
18251  qpref2gat(0.0),
18252  wdepnulrbot(0.0),
18253  wdepnulrsti(0.0),
18254  wdepnulrgat(0.0),
18255  wdepnulrinvbot(0.0),
18256  wdepnulrinvsti(0.0),
18257  wdepnulrinvgat(0.0),
18258  VBIRBOTinv(0.0),
18259  VBIRSTIinv(0.0),
18260  VBIRGATinv(0.0),
18261  deltaEbot(0.0),
18262  deltaEsti(0.0),
18263  deltaEgat(0.0),
18264  atatbot(0.0),
18265  atatsti(0.0),
18266  atatgat(0.0),
18267  btatpartbot(0.0),
18268  btatpartsti(0.0),
18269  btatpartgat(0.0),
18270  fbbtbot(0.0),
18271  fbbtsti(0.0),
18272  fbbtgat(0.0),
18273  fstopbot(0.0),
18274  fstopsti(0.0),
18275  fstopgat(0.0),
18276  VBRinvbot(0.0),
18277  VBRinvsti(0.0),
18278  VBRinvgat(0.0),
18279  slopebot(0.0),
18280  slopesti(0.0),
18281  slopegat(0.0),
18282  CJORBOTS_i(0.0),
18283  CJORSTIS_i(0.0),
18284  CJORGATS_i(0.0),
18285  VBIRBOTS_i(0.0),
18286  VBIRSTIS_i(0.0),
18287  VBIRGATS_i(0.0),
18288  PBOTS_i(0.0),
18289  PSTIS_i(0.0),
18290  PGATS_i(0.0),
18291  PHIGBOTS_i(0.0),
18292  PHIGSTIS_i(0.0),
18293  PHIGGATS_i(0.0),
18294  IDSATRBOTS_i(0.0),
18295  IDSATRSTIS_i(0.0),
18296  IDSATRGATS_i(0.0),
18297  XJUNSTIS_i(0.0),
18298  XJUNGATS_i(0.0),
18299  CSRHBOTS_i(0.0),
18300  CSRHSTIS_i(0.0),
18301  CSRHGATS_i(0.0),
18302  CTATBOTS_i(0.0),
18303  CTATSTIS_i(0.0),
18304  CTATGATS_i(0.0),
18305  MEFFTATBOTS_i(0.0),
18306  MEFFTATSTIS_i(0.0),
18307  MEFFTATGATS_i(0.0),
18308  CBBTBOTS_i(0.0),
18309  CBBTSTIS_i(0.0),
18310  CBBTGATS_i(0.0),
18311  FBBTRBOTS_i(0.0),
18312  FBBTRSTIS_i(0.0),
18313  FBBTRGATS_i(0.0),
18314  STFBBTBOTS_i(0.0),
18315  STFBBTSTIS_i(0.0),
18316  STFBBTGATS_i(0.0),
18317  VBRBOTS_i(0.0),
18318  VBRSTIS_i(0.0),
18319  VBRGATS_i(0.0),
18320  PBRBOTS_i(0.0),
18321  PBRSTIS_i(0.0),
18322  PBRGATS_i(0.0),
18323  CJORBOTD_i(0.0),
18324  CJORSTID_i(0.0),
18325  CJORGATD_i(0.0),
18326  VBIRBOTD_i(0.0),
18327  VBIRSTID_i(0.0),
18328  VBIRGATD_i(0.0),
18329  PBOTD_i(0.0),
18330  PSTID_i(0.0),
18331  PGATD_i(0.0),
18332  PHIGBOTD_i(0.0),
18333  PHIGSTID_i(0.0),
18334  PHIGGATD_i(0.0),
18335  IDSATRBOTD_i(0.0),
18336  IDSATRSTID_i(0.0),
18337  IDSATRGATD_i(0.0),
18338  XJUNSTID_i(0.0),
18339  XJUNGATD_i(0.0),
18340  CSRHBOTD_i(0.0),
18341  CSRHSTID_i(0.0),
18342  CSRHGATD_i(0.0),
18343  CTATBOTD_i(0.0),
18344  CTATSTID_i(0.0),
18345  CTATGATD_i(0.0),
18346  MEFFTATBOTD_i(0.0),
18347  MEFFTATSTID_i(0.0),
18348  MEFFTATGATD_i(0.0),
18349  CBBTBOTD_i(0.0),
18350  CBBTSTID_i(0.0),
18351  CBBTGATD_i(0.0),
18352  FBBTRBOTD_i(0.0),
18353  FBBTRSTID_i(0.0),
18354  FBBTRGATD_i(0.0),
18355  STFBBTBOTD_i(0.0),
18356  STFBBTSTID_i(0.0),
18357  STFBBTGATD_i(0.0),
18358  VBRBOTD_i(0.0),
18359  VBRSTID_i(0.0),
18360  VBRGATD_i(0.0),
18361  PBRBOTD_i(0.0),
18362  PBRSTID_i(0.0),
18363  PBRGATD_i(0.0),
18364  VJUNREFS_i(0.0),
18365  FJUNQS_i(0.0),
18366  VJUNREFD_i(0.0),
18367  FJUNQD_i(0.0),
18368  phigrbot_s(0.0),
18369  phigrsti_s(0.0),
18370  phigrgat_s(0.0),
18371  phigdbot_s(0.0),
18372  phigdsti_s(0.0),
18373  phigdgat_s(0.0),
18374  ftdbot_s(0.0),
18375  ftdsti_s(0.0),
18376  ftdgat_s(0.0),
18377  idsatbot_s(0.0),
18378  idsatsti_s(0.0),
18379  idsatgat_s(0.0),
18380  ubibot_s(0.0),
18381  ubisti_s(0.0),
18382  ubigat_s(0.0),
18383  vbibot_s(0.0),
18384  vbisti_s(0.0),
18385  vbigat_s(0.0),
18386  vbiinvbot_s(0.0),
18387  vbiinvsti_s(0.0),
18388  vbiinvgat_s(0.0),
18389  one_minus_PBOT_s(0.0),
18390  one_minus_PSTI_s(0.0),
18391  one_minus_PGAT_s(0.0),
18392  one_over_one_minus_PBOT_s(0.0),
18393  one_over_one_minus_PSTI_s(0.0),
18394  one_over_one_minus_PGAT_s(0.0),
18395  cjobot_s(0.0),
18396  cjosti_s(0.0),
18397  cjogat_s(0.0),
18398  qprefbot_s(0.0),
18399  qprefsti_s(0.0),
18400  qprefgat_s(0.0),
18401  qpref2bot_s(0.0),
18402  qpref2sti_s(0.0),
18403  qpref2gat_s(0.0),
18404  wdepnulrbot_s(0.0),
18405  wdepnulrsti_s(0.0),
18406  wdepnulrgat_s(0.0),
18407  wdepnulrinvbot_s(0.0),
18408  wdepnulrinvsti_s(0.0),
18409  wdepnulrinvgat_s(0.0),
18410  VBIRBOTinv_s(0.0),
18411  VBIRSTIinv_s(0.0),
18412  VBIRGATinv_s(0.0),
18413  deltaEbot_s(0.0),
18414  deltaEsti_s(0.0),
18415  deltaEgat_s(0.0),
18416  atatbot_s(0.0),
18417  atatsti_s(0.0),
18418  atatgat_s(0.0),
18419  btatpartbot_s(0.0),
18420  btatpartsti_s(0.0),
18421  btatpartgat_s(0.0),
18422  fbbtbot_s(0.0),
18423  fbbtsti_s(0.0),
18424  fbbtgat_s(0.0),
18425  fstopbot_s(0.0),
18426  fstopsti_s(0.0),
18427  fstopgat_s(0.0),
18428  VBRinvbot_s(0.0),
18429  VBRinvsti_s(0.0),
18430  VBRinvgat_s(0.0),
18431  slopebot_s(0.0),
18432  slopesti_s(0.0),
18433  slopegat_s(0.0),
18434  phigrbot_d(0.0),
18435  phigrsti_d(0.0),
18436  phigrgat_d(0.0),
18437  phigdbot_d(0.0),
18438  phigdsti_d(0.0),
18439  phigdgat_d(0.0),
18440  ftdbot_d(0.0),
18441  ftdsti_d(0.0),
18442  ftdgat_d(0.0),
18443  idsatbot_d(0.0),
18444  idsatsti_d(0.0),
18445  idsatgat_d(0.0),
18446  ubibot_d(0.0),
18447  ubisti_d(0.0),
18448  ubigat_d(0.0),
18449  vbibot_d(0.0),
18450  vbisti_d(0.0),
18451  vbigat_d(0.0),
18452  vbiinvbot_d(0.0),
18453  vbiinvsti_d(0.0),
18454  vbiinvgat_d(0.0),
18455  one_minus_PBOT_d(0.0),
18456  one_minus_PSTI_d(0.0),
18457  one_minus_PGAT_d(0.0),
18458  one_over_one_minus_PBOT_d(0.0),
18459  one_over_one_minus_PSTI_d(0.0),
18460  one_over_one_minus_PGAT_d(0.0),
18461  cjobot_d(0.0),
18462  cjosti_d(0.0),
18463  cjogat_d(0.0),
18464  qprefbot_d(0.0),
18465  qprefsti_d(0.0),
18466  qprefgat_d(0.0),
18467  qpref2bot_d(0.0),
18468  qpref2sti_d(0.0),
18469  qpref2gat_d(0.0),
18470  wdepnulrbot_d(0.0),
18471  wdepnulrsti_d(0.0),
18472  wdepnulrgat_d(0.0),
18473  wdepnulrinvbot_d(0.0),
18474  wdepnulrinvsti_d(0.0),
18475  wdepnulrinvgat_d(0.0),
18476  VBIRBOTinv_d(0.0),
18477  VBIRSTIinv_d(0.0),
18478  VBIRGATinv_d(0.0),
18479  deltaEbot_d(0.0),
18480  deltaEsti_d(0.0),
18481  deltaEgat_d(0.0),
18482  atatbot_d(0.0),
18483  atatsti_d(0.0),
18484  atatgat_d(0.0),
18485  btatpartbot_d(0.0),
18486  btatpartsti_d(0.0),
18487  btatpartgat_d(0.0),
18488  fbbtbot_d(0.0),
18489  fbbtsti_d(0.0),
18490  fbbtgat_d(0.0),
18491  fstopbot_d(0.0),
18492  fstopsti_d(0.0),
18493  fstopgat_d(0.0),
18494  VBRinvbot_d(0.0),
18495  VBRinvsti_d(0.0),
18496  VBRinvgat_d(0.0),
18497  slopebot_d(0.0),
18498  slopesti_d(0.0),
18499  slopegat_d(0.0)
18500 {
18501  // Set params to constant default values (from parTable):
18502  setDefaultParams();
18503 
18504  // Set params according to .model line and constant defaults from metadata:
18505  setModParams(model_block.params);
18506 
18507  // Set any non-constant parameter defaults:
18508  // Set any parameters that were not given and whose defaults depend on other
18509  // parameters:
18510 
18511 
18512  if (!given("XYCEADMSMODTEMP"))
18513  admsModTemp=getDeviceOptions().temp.getImmutableValue<double>();
18514 
18515  // Calculate any parameters specified as expressions:
18516 
18518 
18519  // Manually added code:
18520  if (getType() == "pmos" || getType() == "PMOS")
18521  TYPE = -1;
18522 
18523 
18524  // calculate dependent (ie computed) params and check for errors:
18525  processParams();
18526 }
18527 
18528 //-----------------------------------------------------------------------------
18529 // Function : Model::~Model
18530 // Purpose : destructor
18531 // Special Notes :
18532 // Scope : public
18533 // Creator :
18534 // Creation Date :
18535 //-----------------------------------------------------------------------------
18537 {
18538  std::vector<Instance*>::iterator iterI;
18539  std::vector<Instance*>::iterator firstI = instanceContainer.begin ();
18540  std::vector<Instance*>::iterator lastI = instanceContainer.end ();
18541 
18542  // loop over instances:
18543  for (iterI = firstI; iterI != lastI; ++iterI)
18544  {
18545  delete (*iterI);
18546  }
18547 }
18548 
18549 //-----------------------------------------------------------------------------
18550 // Function : Model::printOutInstances
18551 // Purpose : debugging tool.
18552 // Special Notes :
18553 // Scope : public
18554 // Creator :
18555 // Creation Date :
18556 //-----------------------------------------------------------------------------
18557 std::ostream &Model::printOutInstances(std::ostream &os) const
18558 {
18559  std::vector<Instance*>::const_iterator iter;
18560  std::vector<Instance*>::const_iterator first = instanceContainer.begin();
18561  std::vector<Instance*>::const_iterator last = instanceContainer.end();
18562 
18563  int i;
18564  os << std::endl;
18565  os << " name model name Parameters" << std::endl;
18566  for (i=0, iter=first; iter!=last; ++iter, ++i)
18567  {
18568  os << " " << i << ": " << (*iter)->getName() << " ";
18569  os << getName();
18570 
18571  os << std::endl;
18572  os << "L = " << (*iter)->L << std::endl;
18573  os << "W = " << (*iter)->W << std::endl;
18574  os << "SA = " << (*iter)->SA << std::endl;
18575  os << "SB = " << (*iter)->SB << std::endl;
18576  os << "SD = " << (*iter)->SD << std::endl;
18577  os << "SCA = " << (*iter)->SCA << std::endl;
18578  os << "SCB = " << (*iter)->SCB << std::endl;
18579  os << "SCC = " << (*iter)->SCC << std::endl;
18580  os << "SC = " << (*iter)->SC << std::endl;
18581  os << "NF = " << (*iter)->NF << std::endl;
18582  os << "NGCON = " << (*iter)->NGCON << std::endl;
18583  os << "XGW = " << (*iter)->XGW << std::endl;
18584  os << "NRS = " << (*iter)->NRS << std::endl;
18585  os << "NRD = " << (*iter)->NRD << std::endl;
18586  os << "JW = " << (*iter)->JW << std::endl;
18587  os << "DELVTO = " << (*iter)->DELVTO << std::endl;
18588  os << "FACTUO = " << (*iter)->FACTUO << std::endl;
18589  os << "ABSOURCE = " << (*iter)->ABSOURCE << std::endl;
18590  os << "LSSOURCE = " << (*iter)->LSSOURCE << std::endl;
18591  os << "LGSOURCE = " << (*iter)->LGSOURCE << std::endl;
18592  os << "ABDRAIN = " << (*iter)->ABDRAIN << std::endl;
18593  os << "LSDRAIN = " << (*iter)->LSDRAIN << std::endl;
18594  os << "LGDRAIN = " << (*iter)->LGDRAIN << std::endl;
18595  os << "AS = " << (*iter)->AS << std::endl;
18596  os << "PS = " << (*iter)->PS << std::endl;
18597  os << "AD = " << (*iter)->AD << std::endl;
18598  os << "PD = " << (*iter)->PD << std::endl;
18599  os << "MULT = " << (*iter)->MULT << std::endl;
18600  os << std::endl;
18601  }
18602 
18603  os << std::endl;
18604 
18605  return os;
18606 }
18607 
18608 //-----------------------------------------------------------------------------
18609 // Function : Model::forEachInstance
18610 // Purpose :
18611 // Special Notes :
18612 // Scope : public
18613 // Creator : David Baur
18614 // Creation Date : 2/4/2014
18615 //-----------------------------------------------------------------------------
18616 /// Apply a device instance "op" to all instances associated with this
18617 /// model
18618 ///
18619 /// @param[in] op Operator to apply to all instances.
18620 ///
18621 ///
18622 void Model::forEachInstance(DeviceInstanceOp &op) const /* override */
18623 {
18624  for (std::vector<Instance *>::const_iterator it = instanceContainer.begin(); it != instanceContainer.end(); ++it)
18625  op(*it);
18626 }
18627 
18628 Device *Traits::factory(const Configuration &configuration, const FactoryBlock &factory_block)
18629 {
18630  return new DeviceMaster<Traits>(configuration, factory_block, factory_block.solverState_, factory_block.deviceOptions_);
18631 }
18632 
18634 {
18636  .registerDevice("m", 103)
18637  .registerModelType("nmos", 103)
18638  .registerModelType("pmos", 103);
18639 }
18640 
18641 
18642 
18643 } // namespace ADMSPSP103VA
18644 } // namespace Device
18645 } // namespace Xyce